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] CDATA processing problem using Xerces-J validating parser

[ Lists Home | Date Index | Thread Index ]
  • To: "Tony Opatha" <tonyopatha@yahoo.com>,<xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] CDATA processing problem using Xerces-J validating parser
  • From: "Dare Obasanjo" <dareo@microsoft.com>
  • Date: Wed, 18 Jun 2003 21:57:55 -0700
  • Thread-index: AcM2Hvsu+/46+ohaRm2fbLsUD44iigAAF1Ra
  • Thread-topic: [xml-dev] CDATA processing problem using Xerces-J validating parser

It is a common misconception that information within a CDATA section is not processed by the XML parser but instead is skipped. Unfortunately this is incorrect. CDATA sections are at best a shorthand mechanism that prevents having to escape certain characters not a directive to the XML parser to halt processing until further notice. 

________________________________

From: Tony Opatha [mailto:tonyopatha@yahoo.com]
Sent: Wed 6/18/2003 9:54 PM
To: xml-dev@lists.xml.org
Subject: [xml-dev] CDATA processing problem using Xerces-J validating parser


I have a XML doc instance that contains CDATA section:
"<![CDATA[" and ends with "]]>"
 
Parsers validating this XML are supposed to ignore the
CDATA. XML Spy validates the XML instance fine using
its corresponding XSD which defines the CDATA as
a xsd:string.
 
Now when I use in run-time Xeres-J parser it seems to
be processing the CDATA and obviously fails to
validate the CDATA section since it has all types of
illegal characters in it:
 
Here is the error I get:
 
org.xml.sax.SAXException: Data not belonging to any element encountered: 32.com Record
 
Any ideas why this is a problem.
 
I believe this may be a Xerces 1.4 parser. Does xerces support
correct handling of CDATA???

thanks
 
 
 

________________________________

Do you Yahoo!?
SBC Yahoo! DSL <http://pa.yahoo.com/*http://rd.yahoo.com/evt=1207/*http://promo.yahoo.com/sbc/>  - Now only $29.95 per month!




 

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

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