xsltqt4qdomdocument

How to add <?xml-stylesheet to QDomDocument?


I've created an xml document with QDomDocument class. Now I want to add a link to a style-sheet. Is it possible with QDomDocument?

I couldn't identify a method for it in the documentation.


Solution

  • According to the API documentation it looks like document.insertBefore(document.createProcessingInstruction("xml-stylesheet", "type='text/xsl' href='sheet.xsl'"), document.documentElement()) should do.