How to add xml stylesheet to xml by using the Sax-writer?

Beeb

Member
hello,

I created a XML file with the saxwriter. I've also made a XSL file.
Now i want to add this at the beginning of my xml file.
<?xml-stylesheet type="text/xsl" href="xslExample_fulltable.xsl"?>

Does anybody knows how i can fix this?

thanks a lot!

best regards,

Elise Daans
 
Look at write-processing-instructions method of sax-writer. In your case it would be something like:

Code:
hSax:write-processing-instruction("xml-stylesheet", "type=""text/xsl"" href=""xslExample_fulltable.xsl""").
 
I already tried this .. but i always get an error
moz-screenshot-2.jpg
in this case: STRICT error:write-processing-instruction method passed invalid XML name 'XML stylesheet'.
I tried several combinations before posting this but i can't get it working.


Look at write-processing-instructions method of sax-writer. In your case it would be something like:

Code:
hSax:write-processing-instruction("xml-stylesheet", "type=""text/xsl"" href=""xslExample_fulltable.xsl""").
 
Back
Top