J'ai ce code XML à l'intérieur:XSL-FO Extraction quantité
<InvoiceList>
<Invoice>
<InvoiceAmount WithVATBool="false" VATAmount="96.2" VATPercentage="1" WithVAT="9716.19">9619.99</InvoiceAmount>
</Invoice>
</InvoiceList>
Je veux extraire ce montant 9619,99 et le suivant à l'intérieur FOP:
<xsl:value-of select="//Task/InvoiceList/Invoice/InvoiceAmount"/>
me donne ceci sur mon modèle 9619,99196. 2
Toute idée comment extraire cela parce que j'ai essayé avec substring-après et puis je reçois NaN.
Merci!
Stylesheet utilisé:
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.stylusstudio.com/xquery"
xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:output indent="yes" encoding="utf-8"/>
<xsl:variable name="brojac" select="0"/>
<xsl:variable name="timeBase" select="number(//TimeBase/@Val)"/>
<xsl:variable name="filefolder" select="/data/imagepath" />
<xsl:template match="/data">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
master-name="default-page"
page-height="279.4mm"
page-width="215.9mm"
margin-left="1cm"
margin-right="1cm"
margin-top="0.5cm"
margin-bottom="0.5cm">
<fo:region-body margin-bottom="2cm"/>
<fo:region-after extent="1cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="default-page">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="/data" mode="case_data"/>
<fo:block>
<fo:table
space-after="0.25cm"
table-layout="fixed"
width="100%"
color="black"
font-family="Arial"
font-size="10px"
text-align="center"
height="14px">
<fo:table-column column-width="100%"/>
<fo:table-body>
<fo:table-row height="14px">
<fo:table-cell
font-family="Arial"
font-size="10px"
text-align="center"
color="black"
height="14px">
<fo:block>
Član 1.
</fo:block>
<fo:block text-align="justify">
<xsl:value-of select="//Task/InvoiceList/Invoice/InvoiceAmount" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
J'ai enlevé toutes les tables unecessary ..
Vous avez vraiment besoin d'afficher une feuille de style complète qui montre le problème, car la ligne unique que vous avez montrée ne donnera pas la sortie que vous affichez actuellement. Le problème est presque certainement ailleurs dans votre XSLT. Je vous remercie. –
Stylsheet est ci-dessus .. –
Je n'ai pas réussi à recréer le problème avec ça. Voir http://xsltransform.net/pNmBy1T. Je remarque que vous faites ' ' mais il n'y a pas de noeud 'case_data' dans votre XSLT, alors peut-être que le problème est là? –