I'm not sure how you're building myDomDocument but it sounds like you
may not have namespace support turned on in your DOM builder. If that
is the case, please let me know so that I can include this as a FAQ
since it does come up from time to time.
Gary
Etienne Deleflie wrote:
>
> Hello,
>
> I am writing an XSL stylesheet on the fly, as a DOM document.
>
> Printed out, it looks like this ...........
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <xsl:call-template name="bob" />
> </xsl:template>
> <xsl:include href="gaga-html.xsl" />
> </xsl:stylesheet>
>
> Strange thing is, when I use Xalan thus .....
>
> transformer = factory.newTransformer( new DOMSource( myDomDocument )
> );
>
> I get a Transform error: "stylesheet requires attribute: version" and
> stdout tells me
> file:////opt/Centauri/bin/javax.xml.transform.dom.DOMSource; Line 0;
> Column 0;
>
> So I have tried writing that stylesheet to disk and then passing it as a
> StreamSource instead ...
>
> transformer = factory.newTransformer( new
> StreamSource(myXslFileURLtoString()) );
>
> and this works!!! so my document seems to be correct.
> smells like a bug.
>
> am I missing something? does any one know either a workaround, or have a
> suggestion or ....
>
> etienne