OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Problems with CDATA

[ Lists Home | Date Index | Thread Index ]
  • To: Michael Kay <mike@saxonica.com>, xml-dev@lists.xml.org
  • Subject: RE: [xml-dev] Problems with CDATA
  • From: Ciaran Bruen <cbruen1@yahoo.com>
  • Date: Fri, 10 Mar 2006 09:35:43 +0000 (GMT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TPh/5cXngLJiqEtrlEWqk6lciyi1pr/scPaCooRnzjXncQJUMcXcEgs7MuqPfGr8csMYh1FnpCA3m+/UiAfTOSIpSThbXpboA793sOsdKl6EJaXko23t9sgXVpVTNITiAS5RY95bjt4JMpQ5QgQfA+P3693L7ZZgtyuph8tQGFc= ;

Hi Michael - thanks for the reply. The xsl processing that I am performing is an intermediate step that passes on the resulting xml to another xsl stylesheet that performs the final step, so I need to keep the CDATA sections.
 
To process the XML I'm using Javax/TraX inside a java bean - these are the imported clases:
 
// Imported TraX classes
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerConfigurationException;
 
Any more suggestions or ideas are greatly appreciated - thanks a lot.
 
Ciaran.
 
 

Michael Kay <mike@saxonica.com> wrote:
 > The first problem was that it was not keeping any of the CDATA sections around any elements - it was simply removing them and just copying the text inside the sections.  
 
That's correct behaviour. CDATA is considered to be just an input convenience, to save you using lots of entity and character references for special characters. If there aren't any special characters, then the CDATA brackets are just noise.
 
 I then added cdata-section-elements="UNIQUEJVID" and cdata-section-elements="TITLE" (in a new line) to the xsl:output section of the xsl. This returned the CDATA section around these element but incorrectly - as in below:  
 
This looks like a quirk of the XSLT processor you are using, you should report it on the support channel for that processor (or at the very least, tell us which processor you are using.)
 
Michael Kay
http://www.saxonica.com/
 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS