Its not completely clear what youre asking for.
Are you simply trying to determine if each book has a an entry in the
sort_index for its month?
If the sort_index always has all twelve months, how can it never be the case?
Or are you trying to validate the values of the book/d elements to verify that
they are understandable dates?
Cheers,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>
From: Dave Pawson dave.pawson@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tuesday, August 2, 2022 at 9:10 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Member function?
[External Email]
xpath 2 or 3
I have a sort index
<d:sort_index name="my_sort">
<d:entry key="Jan" index="0"/>
<d:entry key="Feb" index="1"/>
<d:entry key="Mar" index="2"/>
<d:entry key="Apr" index="3"/>
<d:entry key="May" index="4"/>
<d:entry key="Jun" index="5"/>
<d:entry key="Jul" index="6"/>
<d:entry key="Aug" index="7"/>
<d:entry key="Sep" index="8"/>
<d:entry key="Oct" index="9"/>
<d:entry key="Nov" index="10"/>
<d:entry key="Dec" index="11"/>
</d:sort_index>
<xsl:variable name="sort_index" select="document('')//d:sort_index"/>
and xml with many
<book>
<author>
<f>H</f>
<s>Stone</s>
</author>
<t>Jane Doe</t>
<d>Jul 2018</d>
</book>
I want to check that the d element (month) has an entry in the sort
index using xsl:for-each over //book/d
Suggestions please?
TiA
--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
|