xsl-list
[Top] [All Lists]

Re: Processing CDATA in input XML

2004-02-06 17:09:03
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(_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

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



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