|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
xml to xslfo using xslt doesnt work?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"); } |
|
|
Re: xml to xslfo using xslt doesnt work?On 2/23/07, helen_166 <helen_166@...> wrote: > <xsl:template match='/' mode='ffp'> > > </xsl:template> If the contents of your root node (/) template is blank, then XSLT is really doing nothing (it'll generate nothing). Which I think is not a useful output. You need to put some XSLT instructions in the root node template. -- Regards, Mukul Gandhi |
|
|
|
|
|
Re: xml to xslfo using xslt doesnt work?yes your right i changed
<xsl:template match='Resume/StructuredXMLResume'> and it worked thanks for your help!
|
| Free embeddable forum powered by Nabble | Forum Help |