You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by St...@r2isante.fr on 2000/10/23 08:57:53 UTC
Réf. : How to include a xsl reference in a xml file when generating xml through parsers.
Hi Thiyaghu !
First, you've to reference the XSL in your DOM Tree :
try {
doc.appendChild(doc.createProcessingInstruction("xml-stylesheet","href='myXsl.xsl' type='text/xsl'"));
} catch ...
Then, you've to serialize your DOMTree as following :
try {
OutputFormat format = new OutputFormat( doc);
fichierXml = new FileWriter("myFile.xml");
XMLSerializer serialiseur = new XMLSerializer( fichierXml, format );
serialiseur.asDOMSerializer();
serialiseur.serialize(doc); // <-- !!!! You've to serialize the entire doc (not only from doc.getDocumentElement())
fichierXml.close();
} catch ...
Hope this helps...
Stéphane RAULT
R2I-Développement
8, rue du blanc
14000 Caen - FRANCE
"Muthuswamy, Thiyaghu" <th...@SYSTECHUSA.com> le 20/10/2000 19:41:07
Veuillez répondre à xerces-j-dev@xml.apache.org
Pour : "'xerces-j-dev@xml.apache.org'" <xe...@xml.apache.org>
cc :
Objet : How to include a xsl reference in a xml file when generating xml
through parsers.
Hi all,
Im generating a XML using xerces parser.I want to refer a xsl in that
xml.Is there any method in the parser which I could use to set reference to
a XSL file.
Thanx,
Thiyaghu
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org