When I run this code:

try {
  File fo = new File("C:/file.fo");
  File xslt = new File("C:/file.xsl");
  File xml = new File("C:/file.xsl");

  OutputStream out = new java.io.FileOutputStream(fo);
  Document doc = getXMLDocumentFrom(xml);

  TransformerFactory factory = TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer(
                                new StreamSource(xslt));

  DOMSource src = new DOMSource(doc.getDocumentElement());
  Result res = new StreamResult(out);

  transformer.transform(src, res);
} catch (Exception ex) {}
finally {out.close();}

the resulting file contains just data from file.xml - not the .fo file, I was expecting.

When I create src directly from file.xml:
Source src = new StreamSource(xml);

which root element has schema attributes (like xmlns and so on) the result is the same.

but when I use xml file where root element doesn't have schema attributes (or doesn't have any attributes), the resulting file.fo is correct.

What I'm doing wrong?

Thanks for any help.

--
greetings,
  Michał Rybak

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to