XSLT: Transforming into non-xml content?
Posted
by Ian Boyd
on Stack Overflow
See other posts from Stack Overflow
or by Ian Boyd
Published on 2010-05-01T11:54:24Z
Indexed on
2010/05/01
11:57 UTC
Read the original article
Hit count: 277
Is it possible to use XSLT to transform XML into something other than XML?
e.g. i want the final non-xml content:
<HTML>
<BODY>
<IMG src="file1.png"><BR>
<IMG src="file2.png"><BR>
...
<IMG src="filen.png"><BR>
</BODY>
</HTML>
You'll notice this document is HTML, because in HTML IMG
and BR
tags are forbidden from having a closing tag. This constrasts with xhtml, the reformulation of HTML using xml, where all elements are required from having a closing tag (because in xml every tag must be closed).
Is it possible, using XSLT, to generate non-xml output?
Another example of non-xml output might be:
INSERT INTO Documents (Filename) VALUES ('file1.png')
INSERT INTO Documents (Filename) VALUES ('file2.png')
...
INSERT INTO Documents (Filename) VALUES ('file3.png')
The reason i ask is that as soon as my XSLT contains an <IMG>
, the stylesheet contains an error; no closing </IMG>
.
© Stack Overflow or respective owner