Inconsistent SAX parser behaviour: UNICODE CHARACTER REFERENCES & ENTITIES ?
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
BDY.TXT
(text/plain, 1.7 KB)
Hi,
I have been experimenting with entities and character references and
have now reached a state of total confusion.
According to my knowledge about ENTITIES and character references the
subtle but important difference between the two is that the parser (is
supposed to) expand character references immediately.
Thus, writing ' " ' or '"' would not be identical, since the latter
is an entity and is not expanded at parse-time,
whereas writing ' " ' or '"' should have the same effect since the
latter is a character reference and thus should be expanded at
parse-time.
Following, this logic if I have a 3 elements in my XML file
1) <foo name="A"B"> ... </foo>
2) <foo name="A&x34;B"> ... </foo>
3) <foo name="A"B"> ... </foo>
the first should be parsed okay while the last two should give me a
parser error. However, I find that the first TWO are parsed okay while
the third results in a parse error. The SAX parser implementation I am
using is CRIMSON.
It is essential for my application to deal with these occurences of
unicode character references and entities. Things are getting a bit
complicated now that I figured out that the parser does not behave as
expected.
I would greatly appreciate if someone could shed some light on this.
THANKS !!!!
Stefan
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel