XML InputStage - Getting all Element Values from XML File
Posted: Wed Jan 30, 2008 3:18 pm
I have to extract values from all MappingElement ElementId in following XML File.
Xpath
I am not able to extract Second element
MappingElement ElementId="P2"
Thanks in advance!!
Code: Select all
<Response>
<Header/>
<XmlTransaction>
<TransName>MAP</TransName>
<Completiontext>Successful</Completiontext>
<CompletionCode>1</CompletionCode>
<ReferenceMapping>
<AppSource>XX</AppSource>
<TargetSystemId>YY</TargetSystemId>
<EffectiveDt>2008-01-30</EffectiveDt>
<Attributes/>
<Codes>
<MappingElement ElementId="P1">
<SourceGroup>
<Off>777</Off>
<PSS>03456</PSS>
</SourceGroup>
<TargetGroup>
<HF>55403456</HF>
</TargetGroup>
</MappingElement>
<MappingElement ElementId="P2">
<SourceGroup>
<Country>US</Country>
</SourceGroup>
<TargetGroup>
<Country>001</Country>
</TargetGroup>
</MappingElement>
</Codes>
</ReferenceMapping>
</XmlTransaction>
</Response>
Xpath
I am not able to extract Second element
MappingElement ElementId="P2"
Thanks in advance!!