XPath dummy question!!!

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XPath dummy question!!!

victor panizza-2
Hello all, just a dummy xpath question.

Could I navigate in XPath through an IDREF to the referenced element. For example:

<root>
    <element1 id="ref">
       <element1-child/>
    </element1>
   <element2>
       <element-ref>ref</element-ref>
   </element2>
</root>

/root/element2/element-ref/element1-child

Or the idref is juts a constraint like a primary key in a database table?

Any help, thanks in advance!!


Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XPath dummy question!!!

Daniel E. Renfer
On 6/8/07, victor panizza <[hidden email]> wrote:

> Hello all, just a dummy xpath question.
>
> Could I navigate in XPath through an IDREF to the referenced element. For
> example:
>
> <root>
>     <element1 id="ref">
>        <element1-child/>
>     </element1>
>    <element2>
>        <element-ref>ref</element-ref>
>    </element2>
> </root>
>
> /root/element2/element-ref/element1-child
>
> Or the idref is juts a constraint like a primary key in a database table?
>
> Any help, thanks in advance!!
IDREF is just a constraint type. It says that the value of that type
has to match an id elsewhere in the document.

What you are trying to do could be achieved by:

/root/element1[@id = /root/element2/element-ref]/element1-child

or

id( /root/element2/element-ref )/element1-child

Note: the second one will only work if the @id is declared as type xs:id [1]

[1]: http://www.w3.org/TR/xpath-functions/#func-id


--
Daniel E. Renfer
http://kronkltd.net/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XPath dummy question!!!

victor panizza-2
Thanks Daniel!!!!
It's help me a bunch


"Daniel E. Renfer" <[hidden email]> wrote:
On 6/8/07, victor panizza wrote:

> Hello all, just a dummy xpath question.
>
> Could I navigate in XPath through an IDREF to the referenced element. For
> example:
>
>
>
>
>

>
> ref
>

>

>
> /root/element2/element-ref/element1-child
>
> Or the idref is juts a constraint like a primary key in a database table?
>
> Any help, thanks in advance!!

IDREF is just a constraint type. It says that the value of that type
has to match an id elsewhere in the document.

What you are trying to do could be achieved by:

/root/element1[@id = /root/element2/element-ref]/element1-child

or

id( /root/element2/element-ref )/element1-child

Note: the second one will only work if the @id is declared as type xs:id [1]

[1]: http://www.w3.org/TR/xpath-functions/#func-id


--
Daniel E. Renfer
http://kronkltd.net/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


Don't get soaked. Take a quick peak at the forecast
with theYahoo! Search weather shortcut.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws