Open otcdlink-simpleuser opened 6 years ago
I just figured out that ENTITY_REFERENCE
does work inside an Element's text. When the test case parses "<whatever>&replace-me;</whatever>"
the ENTITY_REFERENCE
happens.
Is there any way to hook on entity resolution when parsing an Attribute?
I'm looking at ReaderScanner
's code around line 1066 and 897 and obviously the parser wants such an undefined entity to fail. Sounds like bad news for me.
OK I got it. I should ask for unresolved entities and resolve them on my own instead of relying on ENTITY_REFERENCE
since it's probably not supposed to work with Attributes.
The problem is, disabling entity resolution is not yet possible. I'm opening another issue for that.
I need to resolve custom XML entities in some custom event handler/function. Sadly, an unknown entity doesn't trigger the
XMLEvent.ENTITY_REFERENCE
event. If this feature is not implemented, is there any workaround?Here is a test case showing what I expect from Aalto. I'm using aalto-xml 1.1.0.
All I get is an exception: