<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>nopaper.net &#187; XML</title>
	<atom:link href="http://www.nopaper.net/category/xml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nopaper.net</link>
	<description>home of Ryan Stephenson</description>
	<pubDate>Tue, 19 Aug 2008 22:35:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Preserve HTML in XML with XSL</title>
		<link>http://www.nopaper.net/2006/05/23/preserve-html-in-xml-with-xsl.html</link>
		<comments>http://www.nopaper.net/2006/05/23/preserve-html-in-xml-with-xsl.html#comments</comments>
		<pubDate>Tue, 23 May 2006 17:47:18 +0000</pubDate>
		<dc:creator>Ryan Stephenson</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://nopaper.net/2006/05/23/preserve-html-in-xml-with-xsl.html</guid>
		<description><![CDATA[I spent longer on this than I should have, when the answer is so simple; I&#8217;m posting here to remind myself when it comes up again, and I hope the included keywords assist in anyone&#8217;s search for the same information.
The xsl:copy-of element can be used to insert a result tree fragment into the result tree, [...]]]></description>
			<content:encoded><![CDATA[<p>I spent longer on this than I should have, when the answer is so simple; I&#8217;m posting here to remind myself when it comes up again, and I hope the included keywords assist in anyone&#8217;s search for the same information.</p>
<blockquote><p>The <a href="http://www.w3.org/TR/xslt#copy-of">xsl:copy-of</a> element can be used to insert a result tree fragment into the result tree, without first converting it to a string as <a href="http://www.w3.org/TR/xslt#value-of">xsl:value-of</a> does</p></blockquote>
<p>1) I&#8217;m assuming you have XHTML nested in your XML document, if you&#8217;re not well-formed, that&#8217;s your first problem to address.  You can&#8217;t validate something you don&#8217;t restrict.</p>
<p>2) In your xsl:stylesheet, declare your intent to display HTML markup with:<br />
<code>&lt;xsl:output method="html"/&gt;</code></p>
<p>3) In your xsl:template, extract the XHTML with:<br />
<code>&lt;xsl:copy-of select="nodeContainingHtml"/&gt;</code></p>
<p>If you think you want to instead use output=&#8221;text&#8221; and CDATA to push your non-XHTML markup through, return to step 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nopaper.net/2006/05/23/preserve-html-in-xml-with-xsl.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
