xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bertoni <dbert...@apache.org>
Subject Re: adding XSL line
Date Sun, 13 Jul 2008 19:09:08 GMT
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"?>
> ...
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.


View raw message