Esteban Gonzalez wrote:
> Im running out of ideas.

For a start, if you have still stuff after this:
>>> trans.transform( new DOMSource( voucher ), new
>>>    SAXResult( driver.getContentHandler() ));

delete it. Especially delete the call to render().
It is possible that the error is generated by the
second attempt at rendering the DOM document. The
trans.transform() already renders the document.

Further:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href="c:\enhydra\xml1\assistcard\com\icard\xml\voucher.xsl"?>

There is no need for a stylesheet to link to a stylesheet (or itself). Delete this. In particular: > <?xml-stylesheet type="text/xsl" there is no such MIME type, if you use such a PI to link a stylesheet to an XML file (for client side processing), use text/xml.

If all else fails, use a stylesheet to extract the
version of the style sheet, like

--- dump.xsl ---
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="/">
    <xsl:value-of select="*/@version"/>
  </xsl:template>
</xsl:stylesheet>


Document xsl = xml.getXSL(); Transformer trans = TransformerFactory.newInstance() .newTransformer(new StreamSource("dump.xsl")); trans.transform( new DOMSource(xsl), new StreamResult("dump.result")); The result should be something like <?xml version="1.0" encoding="utf-8"?>1.0

J.Pietschmann



Reply via email to