xpath query to find the root element attribute value
Most of the time i was trying to write xpath query by myself and fails all the time :(. Again i got in to problem to find the val开发者_运维问答ue
here is my xml
<Tail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="45000061" CreateDateTime="2010-03-08T16:02:52.512+11:00" Type="Actual" Sender="DRNA" Receiver="Lawson">
Am trying to find the "ID" value in my root node (that's suppose to be "45000061")
Any help please.
Thanks in Advance
The xpath expression /Tail/@Id
you get you the Id
attribute value.
This site has a great free tool for building XPath Expressions (XPath Builder).
http://www.bubasoft.net/
Make your xpath expression work in the tool and then put it in your code.
精彩评论