Re: [xml] Differences in DOM parsing on Windows and UNIX?



In investigating this further, I found we built the Windows version without
thread support and the UNIX version with thread support.  I also found we
were intentionally trying to turn blank text nodes off by making a call to
"xmlKeepBlanksDefault(0)" to make the DOM tree easier to work with.
Apparently this does not work in multi-threaded mode.  There appears to be
another call - "xmlThrDefKeepBlanksDefault" - that must be used in this
case.  But, this seems to be compiled out if threads are not enabled.  We
therefore ended up with the following initialization logic in our main code:

#ifdef LIBXML_THREAD_ENABLED
         xmlThrDefKeepBlanksDefaultValue(0);
#else
         xmlKeepBlanksDefault(0);
#endif

Kind of messy.  It would seem this could be kept under the covers somewhere
(or perhaps it is and we missed it).

Regards,

Ed Day


----- Original Message -----
From: "Daniel Veillard" <veillard redhat com>
To: "Ed Day" <eday obj-sys com>
Cc: <xml gnome org>
Sent: Friday, October 03, 2003 11:58 AM
Subject: Re: [xml] Differences in DOM parsing on Windows and UNIX?


On Fri, Oct 03, 2003 at 11:58:08AM -0400, Ed Day wrote:
Extra text nodes are inserted for whitespace.  Is this a configuration
issue?  If not, which version is correct?

I used the standard out-of-the-box build procedure in both cases and
built from source code instead of using the pre-compiled binaries.  Has
anyone else observed this behavior?  It would be good to know before I start
digging into the code.

  Hum, sounds like xmlKeepBlanksDefaultValue is wrongly initialized to 0
on your Windows build while it should be 1 as properly compiled on Unix.
/**
 * xmlKeepBlanksDefaultValue:
 *
 * Global setting, indicate that the parser should keep all blanks
 * nodes found in the content
 * Activated by default, this is actually needed to have the parser
 * conformant to the XML Recommendation, however the option is kept
 * for some applications since this was libxml1 default behaviour.
 */
int xmlKeepBlanksDefaultValue = 1;

see if your compiler miscompiled globals.c on Windows.

Daniel

--
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml





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