Home / Programming / Blog article: Output DOCTYPE In XSLT

| RSS

Output DOCTYPE In XSLT

September 16th, 2009 | 2 Comments | Posted in Programming

These days I am working on a personal project which I call “my precious”. This projects involves transforming XML documents into HTML using XSLT. Things were going smooth till I decided to output DOCTYPE from XSLT. This is what I did.

 XSLT 

XSLT parser does not like the code above and gives me this error.

XSLT

After scratching my head for a while and navigating through intellisense few times I found the right solution. The way to output DOCTYPE in XSLT is by placing in inside a CDATA. The following code works like a charm.

XSLT

This I thought was worth sharing.






Leave a Reply 1071 views, 3 so far today |
Tags: ,
Follow Discussion

2 Responses to “Output DOCTYPE In XSLT”

  1. stevej Says:
  2. Deepak Says:

    Thanks Stevej.

Leave a Reply