Altova Mailing List Archives

Re: How to read using xpath

From: Martin Honnen <mahotrash@-----.-->
Date: 9/16/2005 8:14:00 PM

Brian P wrote:

> I'm trying to read this XML document:

> <mserror:errorInfo 
> xmlns:mserror=\"\"> 

If you want to use XPath with XML documents with namespaces then you 
need to bind the prefixes you want to use to the namespace URIs used in 
the XML documents and use those prefixes in the XPath expressions.
So you can use an expression alike
but for that to work you need to make sure that the prefix mserror is 
bound to the URI

How you bind the prefix to the URL depends on the tool you use to 
evaluate the XPath expressions, with .NET you use an XmlNamespaceManager:

With MSXML you need to use the method setProperty to set 
"SelectionNamespaces" as needed:


	Martin Honnen --- MVP XML


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.