Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Xpath parsing problem

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Michael Kay <mike AT saxonica.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Xpath parsing problem
  • Date: Thu, 03 Mar 2011 15:01:46 +0000

>Stating that I don't understand how namespaces fit into xpath queries is not really a help, that's obvious.

I thought it would help point you to the right place in the FAQ/documentation.
So to help me out here, it was my impression that tags within an xml
document
that are not preceeded by<something: do not have namespaces applied, is
this
incorrect?
No. If an element name contains no colon, it takes on the default namespace, which is the one introduced by xmlns="...." on that or the nearest ancestor element that has such a declaration.

If so, then I assume there is some default namespace that
applies to
all tags when one is not specified? If it's too much to explain this to me,
then
could I get a link that would clarify?
Look for the namespaces chapter in the introduction of any basic XML book, or google for "Namespaces tutorial".
Or if its not too difficult, can I get a simple example of using the query
method
with xpath to drill into a document when namespaces are involved?

Yes, it's not too difficult, just google for "XPath default namespace FAQ".

Michael Kay
Saxonica




Archive powered by MHonArc 2.6.24.

Top of Page