Details
-
Type:
Bug
-
Status:
In Progress
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 4.1.2
-
Fix Version/s: None
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
When parsing an XML 1.1 file created by Woodstox, I got the following exception:
Caused by: java.io.CharConversionException: Invalid character 0x9d, can only be included in xml 1.1 using character entities (at char #53563968, byte #53564188) at com.ctc.wstx.io.BaseReader.reportInvalidXml11(BaseReader.java:222) at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:273) at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:87) at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57) at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1019) ... 144 more
It seems that the UTF8Reader checks for characters restricted by XML1.1 spec, but BufferedXmlWriter does not create them. I've attached a patch that fixes the issue in BufferingXmlWriter::writeCharacters(char[] cbuf, int offset, int len). Obviously, other methods should be fixed as well.
BufferedXmlWriter does not create them = BufferedXmlWriter does not replace them with entities.