XSLT obtain a value of revised element in PDF
Posted: Thu Jul 13, 2023 3:01 am
I am trying to pull a value from the critdates element, specifically <revised>.
The XML is:
When I use:
the bookpartno data is printed in the PDF.
When I run a similar code using the revised element:
nothing is returned.
I have tried various combinations of the path, such as revised/@modified, bookmap/revised/@modified, etc., and I have substituted "attribute" for "class" in the above code, but that hasn't helped.
Any ideas as to why this doesn't work for the revised element?
The XML is:
Code: Select all
<bookmeta>
<author></author>
<critdates>
<created date="2023"/>
<revised modified="2024"></revised>
</critdates>
<bookid>
<bookpartno>4598638</bookpartno>
<booknumber>6.2.0</booknumber>
</bookid>
</bookmeta>
Code: Select all
<fo:block>
<xsl:if test="//*[contains(@class, ' bookmap/bookmeta ')][1]">
<xsl:value-of select="//*[contains(@class, ' bookmap/bookpartno ')]/text()"/></xsl:if>
</fo:block>
When I run a similar code using the revised element:
Code: Select all
fo:block>
<xsl:if test="//*[contains(@class, ' bookmap/bookmeta ')][1]">
<xsl:value-of select="//*[contains(@class, ' critdates/revised/@modified ')]/text()"/></xsl:if>
</fo:block>
I have tried various combinations of the path, such as revised/@modified, bookmap/revised/@modified, etc., and I have substituted "attribute" for "class" in the above code, but that hasn't helped.
Any ideas as to why this doesn't work for the revised element?