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: Mike Miller <mm8041 AT gmail.com>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Xpath parsing problem
  • Date: Thu, 3 Mar 2011 09:52:41 -0500

I somewhat realized that namespace issues might be causing my dilema and
to tell you the truth, I think they are more of a pita than they're worth,
but
nevertheless, stating that I don't understand how namespaces fit into xpath
queries is not really a help, that's obvious.

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? 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?

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?

Thanks,
Mike
On Thu, Mar 3, 2011 at 2:56 AM, Dave Pawson <dave.pawson AT gmail.com> wrote:

> On 3 March 2011 00:01, Mike Miller <mm8041 AT gmail.com> wrote:
> > Not sure if this went through the first time:
> >
> > Hi,
> >
> > I'm trying to use Xpath
>
> > So my doc looks like this:
> > <root a bunch of namespace crap>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> > So I tried something like:
> > nodes = doc.query("/root/result/space");
> > then when I dumped the size of nodes, it is 0, but i expected 1 because
> > there is 1
>
> Your 'bunch of namespace crap' isn't crap
> when you want to use xpath.
>
> Perhaps you need a little more understanding there prior
> to using xpath?
>
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>




Archive powered by MHonArc 2.6.24.

Top of Page