Esteban Gonzalez wrote:
This is the error
javax.xml.transform.TransformerConfigurationException: stylesheet requires
attribute: version
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer
And this is the XSL styleSheet
[..]
I pruned your stylesheet and transformed a XML document:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet
type="text/xsl"
href="Z:\steppacher\XML\Temp\voucher.xsl"?>
<vouchers>
<voucher/>
</vouchers>
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="c:\enhydra\xml1\assistcard\com\icard\xml\voucher.xsl"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="vouchers"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master page-height="14in" page-width="8.5in" margin-top="35mm" margin-left="28mm" margin-right="14mm"> <fo:region-body/> <fo:region-before extent="0mm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-name="simple"> <fo:flow flow-name="xsl-region-body"> <fo:block font-size="10pt"> <xsl:call-template name="voucher"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="//vouchers/voucher" name="voucher"> <fo:block>Hello World</fo:block> </xsl:template>
</xsl:stylesheet>
This worked fine using xalan 2.3.1 from command line and with some test code.
It seems it needs someone more versed to help you with this.
Concerning your FO: You should have a look at http://www.dpawson.co.uk/xsl/sect3/bk/index.html.
Ralf
