This discussion is archived
3 Replies Latest reply: Feb 15, 2013 1:49 AM by Anuj Dwivedi RSS

xPath values not identifying payload attributes

898842 Newbie
Currently Being Moderated
Hi.

I'm having an issue with xPath expressions against XML attributes.

The document that I'm trying its able to successful identify the document using:

xPath expression: //*/@StandardMessageIdentifier
Indetification Value: XPTO

when the message is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Envelope Recipient="erde" Sender="dada"
xmlns="http://www.oracle.com/GCCS/ShipperXML">
<ConsolidationList>
<StandardMessageIdentification MessageTypeVersionNumber="2"
StandardMessageIdentifier="XPTO"/>
....


But I'm not able to get other values using xPath like:

xPath Name 1: Version
xPath Expression 1: //*/@MessageTypeVersionNumber


I have alrady tried with different combinations like:

//*[local-name()='Envelope']/*[local-name()='ConsolidationList']/*[local-name()='StandardMessageIdentification']/@MessageTypeVersionNumber
//*[local-name()='Envelope']/*[local-name()='ConsolidationList']/*[local-name()='StandardMessageIdentification']/@MessageTypeVersionNumber/text()
//*[local-name()='StandardMessageIdentification']/@MessageTypeVersionNumber
//*[local-name()='StandardMessageIdentification']/@MessageTypeVersionNumber/text()
etc


When I use xPath over an element instead of going to an attribute it works.

seems that for xPath values its not running the same mechanism as for document identification.

Someone ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points