You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Srikanth Sampath <sr...@sybase.com> on 2003/06/22 01:15:24 UTC

Xerces C++ parser and WhiteSpaces

Hi,
I would like to retain the whitespaces during parsing.

I find that the callback ignorableWhitespace() is NOT called when whitespaces
are encountered during parsing.  The callback characters() is invoked.  
It's mentioned that all validating parsers should use ignorableWhitespace()
for handling whitespaces.  Do we need to set anything in the SAX2 XERCES C++
parser for ignorableWhitespace to be called?

Thanks,
--Srikanth


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Xerces C++ parser and WhiteSpaces

Posted by Michael Glavassevich <mr...@apache.org>.
Hi Srikanth,

In order for the parser to determine what is ignorable whitespace and what
isn't, your document requires a DTD grammar, otherwise it cannot know what
is ignorable and what isn't. And I believe that you should only be getting
ignorableWhitespace calls for whitespace which occurs within an element
that does not have character data (#PCDATA) in its content model, (i.e.
not mixed content).

I hope that helps.

On Sat, 21 Jun 2003, Srikanth Sampath wrote:

> Hi,
> I would like to retain the whitespaces during parsing.
>
> I find that the callback ignorableWhitespace() is NOT called when whitespaces
> are encountered during parsing.  The callback characters() is invoked.
> It's mentioned that all validating parsers should use ignorableWhitespace()
> for handling whitespaces.  Do we need to set anything in the SAX2 XERCES C++
> parser for ignorableWhitespace to be called?
>
> Thanks,
> --Srikanth
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>

--------------------
Michael Glavassevich
mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org