I make invoice pdf throw xsl_fo.
Can someone tell me why sometimes there is a paying blank and sometimes
not, for the same XML invoice data. Please look on my example data below
(i publish appropriate fragments of my xml and xsl files), and say what
i should improve in my test condition.
Best Regards
Ireneusz Michalak
fragment of my invoice XML
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Faktura>
<!-- more invoice data -->
<Egzemplarz Rodzaj="Oryginaďż˝" Id="0" />
<DaneBlankietu>
<RodzajBlankietu>1</RodzajBlankietu>
<Blankiet>
</Blankiet>
</DaneBlankietu>
</Faktura>
fragment of my xsl
<!-- xslt transformation to xsl_fo -->
<xsl:if
test="($Faktura/ProcessingInfo/DaneBlankietu/RodzajBlankietu =1) and
($Faktura/ProcessingInfo/Egzemplarz/@Rodzaj = 'Oryginaďż˝' or
$Faktura/ProcessingInfo/Egzemplarz/@Rodzaj = 'Duplikat')">
<!-- in invoice should be the paying blank -->
</xsl:if>
> Can someone tell me why sometimes there is a paying blank and sometimes
> not, for the same XML invoice data. Please look on my example data below
> (i publish appropriate fragments of my xml and xsl files), and say what
> i should improve in my test condition.
> fragment of my invoice XML
> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
> <Faktura>
> <!-- more invoice data -->
> <Egzemplarz Rodzaj="Oryginaďż˝" Id="0" />
> <DaneBlankietu>
> <RodzajBlankietu>1</RodzajBlankietu>
> <Blankiet>
> </Blankiet>
> </DaneBlankietu>
> </Faktura>
>
>
> fragment of my xsl
> <!-- xslt transformation to xsl_fo -->
> <xsl:if
> test="($Faktura/ProcessingInfo/DaneBlankietu/RodzajBlankietu =1) and
> ($Faktura/ProcessingInfo/Egzemplarz/@Rodzaj =
> 'Oryginaďż˝' or
> $Faktura/ProcessingInfo/Egzemplarz/@Rodzaj =
> 'Duplikat')">
>
> <!-- in invoice should be the paying blank -->
>
> </xsl:if>
Consider to post a minimal but complete XML input and stylesheet that
allows us to reproduce the problem.
Then post the result you get and the result you want instead.
And also tell us which XSLT processor you use.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
Thank You Martin for answer.
Here is details for my problem:
I use XSLCompiledTransform z .net 2.0 and after Xml2PDF Server 2007.
My condition seems to show "There is paying blank showing for invoice"
text.(blanktext)
But this text isn't show. Is much worse this text is sometimes shown for
the same XML File. I don't know why. And which condition i should use to
correct decide will be blank show or not.
In other words I should show blank(in example text only) only when Type
of blank(RodzajBlankietu) is 1, and type of invoice is original or
duplicate. In example xml file comply with these condition but blanktext
isn't shown.
here is simple example but show my problem
XML File
--------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Faktura>
<!-- there was more invoice data -->
<Egzemplarz Rodzaj="Oryginaďż˝" Id="0"/>
<DaneBlankietu>
<RodzajBlankietu>1</RodzajBlankietu>
<Blankiet>
</Blankiet>
</DaneBlankietu>
</Faktura>
--------------------------------------------
XSL File
--------
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin="1.5cm" page-height="29.7cm"
page-width="21cm" master-name="A4-pionowo">
<fo:region-body margin-top="2cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4-pionowo" initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block>Header </fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
There is main data of invoice
</fo:block>
<xsl:if
test="(//Faktura/ProcessingInfo/DaneBlankietu/RodzajBlankietu =1) and
(//Faktura/ProcessingInfo/Egzemplarz/@Rodzaj =
'Oryginaďż˝' or
//Faktura/ProcessingInfo/Egzemplarz/@Rodzaj =
'Duplikat')">
<fo:block>
There is paynig blank showing for invoice
</fo:block>
</xsl:if>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
--------------------------------------------
Sorry for time and trash on group i had bad path to xml tags. I thought
tat i restore problem in my main files in which not always paying blank
was shown. :(
Ireneusz Michalak
correct XSL
---------
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<!-- szablon dla strony A4 w uk�adzie pionowym -->
<fo:simple-page-master margin="1.5cm" page-height="29.7cm"
page-width="21cm" master-name="A4-pionowo">
<fo:region-body margin-top="2cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4-pionowo" initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block>Header </fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
There is main data of invoice
</fo:block>
<xsl:if test="(//Faktura/DaneBlankietu/RodzajBlankietu =1) and
(//Faktura/Egzemplarz/@Rodzaj = 'Oryginaďż˝' or
//Faktura/Egzemplarz/@Rodzaj = 'Duplikat')">
<fo:block>
There is paynig blank showing for invoice
</fo:block>
</xsl:if>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
--------------
>
try (for sure) change condition (in <xsl:if>) change from $Faktura/ProcessingInfo/DaneBlankietu/RodzajBlankietu to $Faktura/ProcessingInfo/DaneBlankietu/RodzajBlankietu/text()
--
td