- From: helen_166 <helen_166@hotmail.com>
- Date: Fri, 23 Feb 2007 08:30:43 -0800 (PST)
- To: www-xsl-fo@w3.org
i have a xml file which i need to transform to xslfo
i have created a java class to convert it but it doesnt convert correctly,
when it converts the file the fo tags are completly removed which isnt what
i want can anyone tell me what im doing wrong
my xslt: (part of)
<?xml version="1.0" encoding="iso-8859-1"?>
<fo:root xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:saxon="http://icl.com/saxon">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="0.75in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<xsl:template match='/' mode='ffp'>
</xsl:template>
</fo:flow>
</fo:page-sequence>
</fo:root>
the java class:
public void CreateXSLFO(String xmldocname, String xsltdocname, String
xslfodocname) {
System.out.println("creating xsl-fo");
File xmldocument = new File(xmldocname);
File xsltdocument = new File(xsltdocname);
File xslfodocument = new File(xslfodocname);
try {
OutputStream outputstream = new
java.io.FileOutputStream(xslfodocument);
TransformerFactory factory = TransformerFactory.newInstance();
//pass the xslt document
Transformer transformer = factory.newTransformer(new
StreamSource(xsltdocument));
//pass the xml document
Source sourse = new StreamSource(xmldocument);
//pass the outputstream (new file)
Result result = new StreamResult(outputstream);
// transform the xslt to xsl-fo using FOP
transformer.transform(sourse, result);
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println("xslfo created");
}
--
View this message in context: http://www.nabble.com/xml-to-xslfo-using-xslt-doesnt-work--tf3279766.html#a9121929
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
Received on Saturday, 24 February 2007 00:28:12 UTC