Bjoern Martin wrote:
>
> > Hi!
>
> Hi.
>
> > [...]
> > root.setAttribute( "version", "1.1" );
> > root.setAttribute( "xmlns:xsl",
> > "http://www.w3.org/1999/XSL/Transform" );
> > [...]
> > I get at this point a "ParserConfigurationException" telling
> > "stylesheet requires attribute: version" and talking about some
> > "Line 0; Column 0;". The stylesheet-element has a version-attribute,
> > as you can see in the code above.
> > [...]
> > Does anybody have an idea, what I made wrong or where the problem
> > lies?
>
> Version 1.1 of the xslt spec doesn't have the namespace you specified.
> Try version 1.0.
>
I just tried it with version "1.0" but no effect :-(
I still think that has something to do with the DOM-representation in
memory, not with the xslt-code itself. It does work if I write it to a
file and then read it with Document dummyDoc = dBuilder.parse(
<filename> );
(Again, my sample-code for the xslt-generation:
DocumentBuilderFactory dFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
Document dummyDoc = dBuilder.newDocument();
Element root = dummyDoc.createElement( "xsl:stylesheet" );
root.setAttribute( "version", "1.1" ); // or "1.0"...
root.setAttribute( "xmlns:xsl",
"http://www.w3.org/1999/XSL/Transform" );
Element el1 = dummyDoc.createElement( "xsl:template" );
el1.setAttribute( "match", "title" );
Element el2 = dummyDoc.createElement( "hr" );
el1.appendChild( el2 );
root.appendChild( el1 );
dummyDoc.appendChild( root );
Does anyone see any error there? )
> Regards.
Thank you anyway...
Martin Sparenberg
>
> --
> Bjoern Martin [EMAIL PROTECTED]