Mine is potentially one of these cases, [...]
A minimized example would be appreciated ;) If you say "all of the other f elements", do you really refer to all elements, or only to the f elements on the current level? In the latter case, following-sibling should do what you need. Using [position() > 1] will be even faster (but it’s probably not applicable to your use case?).
This example indicates what the following axis is doing. It returns 4 results (d, e, f, and g):
<a> <b/> <d><e/></d> <f/> <g/> </a>//b/following::node()
On Fri, Mar 3, 2017 at 4:22 PM, meumapple meumapple@gmail.com wrote:
Hi Christian,
Mine is potentially one of these cases, in that I have to select an f element, which is a word with a reference (@ref='1.2') and then all of the other f elements following that until another f element with another certain value of @ref is reached (irrespectful of the d structures). Consider that there is a mismatch between d elements and f: the elements within a d element could have f elements with different @ref. A solution would be to go from f to parent d, select all of them and then filter out the f elements of the first and last d elements, looking only for those with the right @ref. But I thought that the following:: axis could be a solution. Thanks.
Best, Joseph
Il giorno 03 mar 2017, alle ore 15:54, Christian Grün christian.gruen@gmail.com ha scritto:
Hi Joseph,
There are only rare occassions in which the following axis makes sense. Do you know what it does? Which result would you expect for the given document?
Christian
On Fri, Mar 3, 2017 at 3:50 PM, meumapple meumapple@gmail.com wrote: Hi,
In a file with a structure like
<l> <d> <f>a</f> <f>b</f> <f>c</f> </d> <d> <f>a</f> <f>b</f> <f>c</f> </d> </l>
If I type doc($b)//f[1]/following::f the processor gets out of main memory, even though the file is about 2.2MB and the structure is simply the one showed above (many sibling d elements)
Any idea why? Thanks
Joseph