You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Vaidya, Puja (Exchange)" <PV...@Bear.com> on 2006/12/01 18:01:28 UTC

whitespaces

Hi,

 

I am using xerces-j and xml reader for using the SAX parser by using 

 Class c =Class.forName("org.apache.xerces.parsers.SAXParser") and am
validating the xml file with schema.

 

I have also overloaded the ignorewhitespace method which never gets
called.  The parser considers all the white spaces between elements as
characters and sends everything to character method. 

 

Any thing I m doing wrong or missing ??

 


Re: whitespaces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
"Vaidya, Puja \(Exchange\)" <PV...@Bear.com> wrote on 12/01/2006 
12:01:28 PM:

> Hi,
> 
> I am using xerces-j and xml reader for using the SAX parser by using 
>  Class c =Class.forName("org.apache.xerces.parsers.SAXParser") and 
> am validating the xml file with schema.
> 
> I have also overloaded the ignorewhitespace method which never gets 
> called.  The parser considers all the white spaces between elements 
> as characters and sends everything to character method. 
> 
> Any thing I m doing wrong or missing ??

ignorableWhitespace() is only called for element content whitespace [1]. 
This is only defined in the context of a DTD and doesn't apply to XML 
Schema. See this [2] FAQ for more info.

[1] http://www.w3.org/TR/2006/REC-xml-20060816/#sec-white-space
[2] http://xerces.apache.org/xerces2-j/faq-sax.html#faq-3

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org