Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Parallel data traversal

From: Vojta <dr.fie@------.-->
To: NULL
Date: 9/10/2007 12:49:00 AM

Hi,

I have some xml data looking like this
<root>
  <items1>
    <i1>..</i1>
    <i1>..</i1>
  </items1>
  <items2>
    <i2>..</i2>
    <i2>..</i2>
  </items2>
</root>

If my context node is the k-th node in items1 is to possible to create
XPath that finds a k-th node in items2? Something like "../../
items2[position() = position(.)]" - which does not work because "." is
bound to some "i2" node inside the square brackets.

Some motivation: we use a "repeater" component that traverses child
nodes of one node. The current node in the repeater is the context
node. The user then uses xpaths relative to the current node to get
the data. And I need some hack to be able to reference nodes at the
same position but inside a  different node.

Obviously the most natural solution is to do some data preprocessing
to "zip" items1 and items2 together or modify our repeater to be able
to have multiple context nodes. But isn't there any pure xpath way to
do this?

Thanks



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