java - org.xml.sax.SAXParseException: The character reference must end with the ';' delimiter. Workaround Needed -
I am trying to parse a small XML file to use DOM parser in Java, error semicolon missing Complaint about
Here is the link 108: ...
document document = DocumentBuilderFactory.newInstance () newDocumentBuilder () parsing ("url_to_the_xml_file.xml");
Here's the error:
[severe error] A01.xml: 6: 53: Character reference ';' Delimiter Exception in thread "main" org.xml.sax.SAXParseException: character reference ';' Should be ending with the delimiter. At org.apache.xerces.jaxp.DocumentBuilderImpl.parse on org.apache.xerces.parsers.DOMParser.parse (unknown source) at javax.xml.parsers.DocumentBuilder.parse (DocumentBuilder.java:180) at on Parser.Parse Parser.main at (Parser.java:108) (Parser.java:185)
Parse this line of XML
& lt ; Title & gt; & Amp; Decrease algorithm using the # 1 9 2 Trans Vowellet Transform & Lt; / Title & gt;
Obviously there is a semi colon missing. Does anybody know any good and clean work arounds for this problem?
After
I will retrieve XML separately in one. Byte array / string and replace it on a regex deformed unit before I show it to the parser
I'm not a regex expert but searching for a & #, # \ d {1,4 } [^ ;.] One half of the trick can
If you only distorted this unit, you could just use String.replaceAll ("& amp; # 192", "& amp; ; # 192; ");
Comments
Post a Comment