Re: [xml] ignorableWhitespace-callback



On Thu, Sep 06, 2001 at 04:32:48PM +0200, Henke, Markus wrote:
Hello,

i've a parser context with a self-defined ignorableWhitespaceSAXFunc

  pctxt->sax->ignorableWhitespace = myIgnorableWhitespaceFunc;

which do nothing than to trace the callback.
Now i try to validate a document against it's DTD that doesn't allow CDATA
or mixed content in any Element.
When i got the docs right, the parser has to callback the
ignorableWhitespaceSAXFunc in that scenario
if he runs on whitespace like tabs or CR/LF in the document-body.
But my trace-file remains empty, seems that the ignorableWhitespaceSAXFunc
was ignored...   8)
Or is there something that i've missed?

  Hum,

 all this processing belongs to parser.c:

xmlParseCharData() calls areBlanks() to check for this and
uses the ignorableWhitespace() callback if this is the case.

The xmlIsMixedElement() is called by areBlanks(), and will
return 0 or 1 in the case a DTD is present.

But this processing is conditionned by ctxt->keepBlanks.
You can try to set it by calling xmlKeepBlanksDefault(0) before
calling the parser or creating the context.

I need a better handling for this, I will try to get this fixed
more cleanly in the next version,

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]