I have an XML file to render with XSLT 1.0.
My cas is the following :
If value of
longName
is "Oui_Combi"
$Publication
=prodDate
value (21.11.2018)else
$Publication
=productionDates
value (17.11.2018, 21.11.2018)
I'm not sur my syntax is correct on the for-each and/or on the xsl-if
XML file :
<?xml version="1.0" encoding="UTF-8"?>
<Manuscript dateAndTime="2018-11-16T10:20:59.177+01:00" renderEPS="" forMediation="false">
<Order>
<OrderHeader productionDates="17.11.2018, 21.11.2018">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<Criterion name="TypePublicity" ordering="1">
TypePubOccasionnel <ValueParameter longName="Occasionnel"/>
</Criterion>
<Criterion name="JuraCombi" ordering="2">
Oui_Combi <ValueParameter longName="Oui_Combi"/>
^^^^^^^^^^^^^^^^^^^^
</Criterion>
</OrderHeader>
<FirstIssueData prodDate="21.11.2018"></FirstIssueData>
</Order> ^^^^^^^^^^^^^^^^^^^^^
</Manuscript>
XSL part where I create my variable :
<xsl:for-each select="Order/OrderHeader/Criterion">
<xsl:if test="@name = 'JuraCombi'">
<xsl:if test="ValueParameter/@longName = 'Oui_Combi'">
<xsl:variable name="JuraCombi">
OUI
</xsl:variable>
<xsl:variable name="Publication">
<xsl:value-of select="/Order/FirstIssueData/@prodDate" />
</xsl:variable>
</xsl:if>
<xsl:if test="ValueParameter/@longName != 'Oui_Combi'">
<xsl:variable name="JuraCombi">
NON
</xsl:variable>
<xsl:variable name="Publication">
<xsl:value-of select="/Order/OrderHeader/@productionDates" />
</xsl:variable>
</xsl:if>
</xsl:if>
</xsl:for-each>
...
The XSL part where I want to print my variable $Publication
:
<xsl:template match="OrderHeader">
<fo:table
table-layout="fixed"
width="18cm"
font-size="10pt"
padding="1.0pt">
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="60mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="60mm"/>
<fo:table-body>
...
<fo:table-row>
<fo:table-cell>
<fo:block padding="0.5cm">
Parutions
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="3">
<fo:block padding="0.5cm">
<xsl:copy-of select="$Publication" />
</fo:block> ^^^^^^^^^^^^
</fo:table-cell>
</fo:table-row>
...
</fo:table-body>
</fo:table>
</xsl:template>
Maybe we can achieve it without for-each?
Not any online XSLT tool/checker can get me the detailled error but the rendering stops!
Thanks for help