[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xindice-users
Subject:    Re: xpath queries
From:       "R. Mark Volkmann" <mark () ociweb ! com>
Date:       2004-12-30 0:21:51
Message-ID: 1104366111.41d34a1fdce3e () mail ! ociweb ! com
[Download RAW message or body]

Quoting "R. Mark Volkmann" <mark@ociweb.com>:

> Quoting "R. Mark Volkmann" <mark@ociweb.com>:
>
> > When I run the xpath query "/*" on a collection, it returns all the
> documents
> > in
> > the collection.  The name of their root elements is "service".  When I run
> > the
> > query "/service" I get nothing back.  How can this be?
>
> Here's more detail.
>
> This query returns nothing.
> "/service[@name='Weather']/description"
>
> This query returns the description element.
> "/*[@name='Weather']/*[name()='description']"
>
> It seems that I can't directly use the name of an element in the xpath.
> I think this is a namespace problem.
> What do I have to do to declare the namespace of the elements in my xpath?

Solved!  I have to use -s to specify the namespace.
Here's a working query.

xindice xpath -c %XDB%/services
-q "/p:service[@name='Weather']/p:description"
-s "p=http://www.boeing.com/fcs/service"

--
R. Mark Volkmann
Partner, Object Computing, Inc.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic