[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problems with CDATA

  • To: Michael Kay <mike@s...>, xml-dev@l...
  • Subject: RE: Problems with CDATA
  • From: Ciaran Bruen <cbruen1@y...>
  • 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= ;

javax transformer
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@s...> 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/
 


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.