You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the catalog here to reproduce this issue: #104 (comment)
test.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPEconcept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<conceptid="foo">
<title>foo</title>
<conbody>
<notetype="note"verbose="yes">
<p>The verbose attribute is invalid, and it causes wstx to produce a
null character when writing the XML.</p>
</note>
</conbody>
</concept>
...
Element <note> has no attribute "verbose"
type = 'note' ( 0x6e 0x6f 0x74 0x65 )
verbose = 'yes ' ( 0x79 0x65 0x73 0x00 0x00 0x00 0x00 )
class = '- topic/note ' ( 0x2d 0x20 0x74 0x6f 0x70 0x69 0x63 0x2f 0x6e 0x6f 0x74 0x65 0x20 )
Exception in thread "main" com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output
at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteAttr(BaseNsStreamWriter.java:531)
at com.ctc.wstx.sw.SimpleNsStreamWriter.writeAttribute(SimpleNsStreamWriter.java:90)
at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:61)
at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:108)
at WstxValidatorTest.main(WstxValidatorTest.java:46)
Caused by: java.io.IOException: Invalid null character in text to output
at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:52)
at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:628)
at com.ctc.wstx.sw.BufferingXmlWriter.writeAttrValue(BufferingXmlWriter.java:1082)
at com.ctc.wstx.sw.BufferingXmlWriter.writeAttribute(BufferingXmlWriter.java:925)
at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteAttr(BaseNsStreamWriter.java:528)
... 4 more
Notice the output for the verbose attribute. The attribute value is being padded with extra null characters.
The text was updated successfully, but these errors were encountered:
ChrisTrenkamp
changed the title
Invalid attributes producing extra invalid characters
Invalid attributes producing extra null characters
Apr 14, 2021
cowtowncoder
changed the title
Invalid attributes producing extra null characters
Invalid attributes producing extra null characters during DTD validation
Apr 19, 2021
Use the catalog here to reproduce this issue: #104 (comment)
test.xml
WstxValidatorTest.java
Output:
Notice the output for the
verbose
attribute. The attribute value is being padded with extranull
characters.The text was updated successfully, but these errors were encountered: