Adding Stylesheet to XmlDocument

  • Thread starter Thread starter =?ISO-8859-15?Q?Martin_P=F6pping?=
  • Start date Start date
?

=?ISO-8859-15?Q?Martin_P=F6pping?=

Hello,

is there a way to add a stylhesheet like:

<?xml-stylesheet type="text/css" href="styles.css" ?>

to an XmlDocument?



Regards,
Martin
 
Martin said:
Hello,

is there a way to add a stylhesheet like:

<?xml-stylesheet type="text/css" href="styles.css" ?>

to an XmlDocument?

Add a processing instructions as follows:

XmlProcessingInstruction pi =
yourXmlDocumentInstance.CreateProcessingInstruction("xml-stylesheet",
"type=\"text/css\" href=\"styles.css\"");
yourXmlDocumentInstance.InsertBefore(pi,
yourXmlDocumentInstance.DocumentElement);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top