Hugues Moisy wrote:
Hi all,
I'm new to Xerces C++, and I would just like to add a line to the first
line of the XML file referencing a XSL file, for formatting into
browsers. I don't know how to do it using DOM.
It should look like :
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml-stylesheet href="fichier.xsl" type="text/xsl"?>
<ROOTNODE>
...
You need to create a processing instruction node and insert it before
the document element. The target for the PI will be "xml-stylesheet"
and the data will be the string "href='fichier.xsl' type='text/xsl'"
Note I've changed the quote character to the apostrophe character in
your example, for the sake of clarity, but it doesn't matter which you
actually use. Although the data for the PI looks like attributes, it's
really just a string of text.
Dave