[Expat-bugs] [ expat-Bugs-752139 ] < error
SourceForge.net
noreply at sourceforge.net
Wed Jun 11 10:06:10 EDT 2003
Bugs item #752139, was opened at 2003-06-10 13:03
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=752139&group_id=10127
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: < error
Initial Comment:
<Test>
<Row><OK></Row>
</Test>
For the test case above, I assume the result in
void characterDataHandler(void *userData, const
XML_Char *s, int len)
{
}
*s should be "<OK>"
but the result I got was "<"
Is it a bug or by design?
Thanks.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2003-06-11 09:06
Message:
Logged In: NO
I don't think it's a bug. I'll change my code to follow the
standard. :-)
Please close it.
Thanks.
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2003-06-11 06:41
Message:
Logged In: YES
user_id=290026
The definition of XML_Char in Expat depend on how Expat
is compiled:
- XML_UNICODE defined:
XML_Char = ushort
- XML_UNICODE and XML_UNICODE_WCHAR_T:
XML_Char = wchar_t
- otherwise:
XML_Char = char
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2003-06-11 04:39
Message:
Logged In: NO
Yes, it was not my faulty memory, but my faulty eyes, too.
const XML_Char* s, int len
means, that you get block of XML_Chars in "s", in which
first "len" XML_Chars have meaning. I don't know, what
XML_Char means in your expat. It could be char, or wchar_t,
so one problem is that you treat string "s" as char string when
it is wide-char string (and all you see is first "<\0" sequence),
or you shouldn't use *s (which means "XML_Char at zero
index", hence you get a '<' char), and use s instead
(remembering "len" stuff)
d.n.hotch
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2003-06-11 04:30
Message:
Logged In: NO
And what you got was probably "<OK>" (if my guessing for 60
and 62 chars is correct), but in wide (16b, 2-bytes), not old,
one-byte characters. So "<" 0 "O" 0 "K" 0 ">" 0 and trailing
duble-0 for end-of-string-zero-char. Latter may be my faulty
memory, for callback have probably just block and its width,
not wide-character C-string :) ). Hoping it wasn't to messy.
d.n.hotch
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2003-06-10 13:25
Message:
Logged In: YES
user_id=290026
According to section 4.4 in the XML specs
(XML Processor Treatment of Entities and References)
the behaviour of Expat appears to be correct.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=752139&group_id=10127
More information about the Expat-bugs
mailing list