xsl-list
[Top] [All Lists]

Re: Creating a CDATA tag in output XML

2004-04-08 07:35:25
At 4:09 PM +0530 4/8/04, Yashdeep Patil wrote:

My input XML looks like:
<a><b>123</b></a>

and my XSL snippet looks like :
<xsl:element name="x">
    <xsl:copy-of select="."/>
 </xsl:element>

Now I would like my resultant XML output to look like:
<x >
    <![CDATA[<a><b>123</b></a>]]>
</x>


It's not possible in standard XSLT 1.0, at least not if you're aiming fro faithful reproduction of the input document as text.
--

  Elliotte Rusty Harold
  elharo(_at_)metalab(_dot_)unc(_dot_)edu
  Effective XML (Addison-Wesley, 2003)
  http://www.cafeconleche.org/books/effectivexml
  http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA


<Prev in Thread] Current Thread [Next in Thread>