Hi Steve,
I doubt there's a bug in Xerces -- I suspect the bug is in your code.
SAX makes no guarantee that all of the content of an element will be
delivered in one call to characters(). Since Xerces-C breaks up calls to
characters when dealing with entities, I'll bet your code assumes the
content _will_ be delivered in one call, so you're creating multiple child
elements because there are multiple characters() calls. When you get a
characters() call, you should save the characters in a buffer, then process
the buffer once you get a call to something other than characters().
Hope that helps...
Dave
"Steve Barge"
<[EMAIL PROTECTED] To: <[EMAIL PROTECTED]>
m> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject: Problem parsing <
10/07/2002 10:07
AM
Please respond
to xerces-c-dev
Hi,
I'm using version 1.7 of xerces-c++. I'm having problems parsing the
following:
<smd:attr_li name="ancestor">
<smd:li>Contrib-Tools.PIMTOOL,r<B.11.11,l=/</smd:li>
<smd:li>OS-Core.UX-CORE,r<B.11.11.%,l=/</smd:li>
</smd:attr_li>
The "r<B.11.11" should translate to "r<B.11.11". I have derived a class
from the SAX DefaultHandler and in the ::characters method, the "<" is
converted to '<' but for some reason it thinks that the '<' is then the
beginning of the end tag "</smd:li>" or it thinks it is a new list element
"<smd:li>". So it converts the above to:
<smd:attr_li name="ancestor">
<smd:li>Contrib-Tools.PIMTOOL,r</smd:li>
<smd:li><B.11.11,l=/</smd:li>
<smd:li>OS-Core.UX-CORE,r</smd:li>
<smd:li><B.11.11.%,l=/</smd:li>
</smd:attr_li>
Does anybody know why this is happening? Is this a bug in this version of
xerces-c++ or is this a problem whith the way the '<' is escaped in the
XML?
Thanks in advance!
Steve Barge
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]