When I have this XML
<user>dude & <dudette></user>
I expect to get the following events when I iterate through it via the XmlReader:
START_DOCUMENT
START_ELEMENT localName="user"
TEXT text="dude "
ENTITY_REF text="&"
TEXT text=" "
ENTITY_REF text="<"
TEXT text="dudette"
ENTITY_REF text=">"
END_ELEMENT localName="user"
END_DOCUMENT
However, number 5 doesn't turn up as a TEXT but as an IGNORABLE_WHITESPACE.
I think this is a bug, this is not an ignorable whitespace. Whitespaces between XML elements, such as <user>abc</user> <id>1234</id> would be ignorable.
(By the way, the existence of CDSECT and ENTITY_REF was a pitfall (aka footgun) for me, I assumed before that the XMLReader would already have all text content, i.e. I expected there would be just TEXT text="dude & <dudette>" and then END_ELEMENT.)
When I have this XML
I expect to get the following events when I iterate through it via the
XmlReader:START_DOCUMENTSTART_ELEMENTlocalName="user"TEXTtext="dude "ENTITY_REFtext="&"TEXTtext=" "ENTITY_REFtext="<"TEXTtext="dudette"ENTITY_REFtext=">"END_ELEMENTlocalName="user"END_DOCUMENTHowever, number 5 doesn't turn up as a
TEXTbut as anIGNORABLE_WHITESPACE.I think this is a bug, this is not an ignorable whitespace. Whitespaces between XML elements, such as
<user>abc</user> <id>1234</id>would be ignorable.(By the way, the existence of
CDSECTandENTITY_REFwas a pitfall (aka footgun) for me, I assumed before that the XMLReader would already have all text content, i.e. I expected there would be justTEXTtext="dude & <dudette>" and thenEND_ELEMENT.)