When you give generate-id a nodeset

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

When you give generate-id a nodeset

Ihe Onwuka-2
Came across something unexpected while doing the if/else hack to supply a node to generate-id.

I have <xsl:key match="stuff | morestuff" use="generate-id(ancestor::tr[predicate]  |  ancestor::tr[not(predicate)]/preceding-sibling::tr[predicate])"/>

Some data
<wrapper>
<tr pred="true" id="A">
    <stuff/>
    <stuff/>
</tr>
<tr pred="true" id="B">
    <stuff/>
    <stuff/>
</tr>
 <tr pred="true" id="C">
    <stuff/>
    <stuff/>
</tr>
<tr pred="false">
    <morestuff/>
 </tr>
</wrapper>

So here stuff should  take the id of the tr parent and morestuff shouldl take the id of the tr with id C.

Given that generate-id given  a nodeset only considers the first node I thought wayhay that will work but it didn't until I included a first node predicate explicitly like so.

xsl:key match="stuff | morestuff" use="generate-id(ancestor::tr[predicate]  |  ancestor::tr[not(predicate)]/preceding-sibling::tr[predicate][1])"/>
                                                                                                                                                                                                                    ***
Should such be necessary?. Only tried it running version 1.0 on  XSLTProc


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: When you give generate-id a nodeset

David Carlisle
On 05/11/2015 13:55, Ihe Onwuka wrote:
> Only tried it running version 1.0 on  XSLTProc

er you sent that to the saxon list???

________________________________


The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is:

Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.



This e-mail has been scanned for all viruses by Microsoft Office 365.

________________________________

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: When you give generate-id a nodeset

Ihe Onwuka-2
oops.

On Thu, Nov 5, 2015 at 8:58 AM, David Carlisle <[hidden email]> wrote:
On 05/11/2015 13:55, Ihe Onwuka wrote:
Only tried it running version 1.0 on  XSLTProc

er you sent that to the saxon list???

________________________________


The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is:

Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.



This e-mail has been scanned for all viruses by Microsoft Office 365.

________________________________


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help