Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,


this is my xml message

<MessageList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.tr.com/schema/2009/1.1/MessageList">


am trying to get the value of xmlns="http://www.tr.com/schema/2009/1.1/MessageList"> using xpath query.

xpath query suppose to return "http://www.tr.com/schema/2009/1.1/MessageList".

any help please.

Thanks in advnace
Posted

1 solution

xmlns is not a regular attribute, it is a namespace.
Check here for a number of ways on how to get the value:
http://www.hanselman.com/blog/GetNamespacesFromAnXMLDocumentWithXPathDocumentAndLINQToXML.aspx[^]
 
Share this answer
 
Comments
BobJanova 12-Aug-11 9:52am    
Good link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900