How to retrieve value of an attribute which contains colon in the attribute name using xpath
I have a simple requirement where in I need to fetch the value of attribute
I am making use of a
SAXParser and here is my
xpath:a/aff/@xml:id on the contrary I was able to fetch value of using the
But i was unable to retrieve the value could you please help me?
<?xml version="1.0" encoding="UTF-8" ?> <a> <aff xml:id="af1" value="a"> <uAff> Hello </uAff> </aff> <aff xml:id="corr1"> <uAff> Hello1 </uAff> </aff> </a>
Thanks in advance.
2 Solutions collect form web for “How to retrieve value of an attribute which contains colon in the attribute name using xpath”
To get the value of the attributes you could use:
/a/aff/@xml:id works just fine in getting the values…
Are you trying to get both values?
If you are trying to get just the first value you could use /a/aff/@xml:id