Re: [xsl] Processing CDATA in input XML

Subject: Re: [xsl] Processing CDATA in input XML
From: Elliotte Rusty Harold <elharo@xxxxxxxxxxxxxxx>
Date: Fri, 6 Feb 2004 19:09:03 -0500
At 5:04 PM -0600 2/6/04, Philip Puccio wrote:
Hi,

If my input XML has CDATA that contains a well-formed XML document:

   <plan-text-item-data>
      <source-string-xml type="embeddedXML">
         <![CDATA[
            <?XML version="1.0"?>
               <strategyobservation smartid="FSR0100">
                  <paragraph>Consider annually reviewing your net worth
statement.</paragraph>
            </strategyobservation>
         ]]>
      </source-string-xml>
   </plan-text-item-data>

Is there a way using XSLT that I can emit that document as an XML element:


No. Embedding documents within documents like this is a *very* bad idea. ou should fix the source doucment so it uses a real element in the first place like this:


  <plan-text-item-data>
      <source-string-xml type="embeddedXML">
               <strategyobservation smartid="FSR0100">
                  <paragraph>Consider annually reviewing your net worth
statement.</paragraph>
            </strategyobservation>
      </source-string-xml>
   </plan-text-item-data>

Solving your problem is then trivial.

--

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

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread