Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Using preceding-sibling::node()

From: Jeni Tennison <jeni@---------------->
To:
Date: 11/1/2004 10:15:00 PM
Hi Dilip,

> and if the node with that particular timestamp is not present in
> the XML document I'd like to modify my query
> in such a way that it fetches the node that has a timestamp < 1099119599.
>
> I understand if I change my query to
> child::data[attribute::id =
> 'archive'][@id='archive']/child::timestamp[attribute::time <
> '1099119599']
> then all the nodes with timestamp < 1099119599 get returned

And you want to return just one, right? What about:

  data[@id = 'archive']/timestamp[@time < 1099119599][last()]

Depending on your XML structure -- if the <timestamp> elements that
you're interested in might appear within different <data> elements --
you might need to use brackets as in:

  (data[@id = 'archive']/timestamp[@time < 1099119599])[last()]

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent