I'm doing it in Java XML Parser, then I got this error when parsing an xml file...
[Fatal Error] jira.xml:192:64: The content of elements must consist of well-formed character data or markup. org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at com.icomteq.ReadXMLFile.main(ReadXMLFile.java:20)
Any clue what could be the problem? Thank you.
Here is the code used -> http://s29.postimg.org/tjbzvsn3b/xmlreader.jpg
Here is my jira.xml ->
<?xml version="1.0" ?>
<DATA_RECORD>
<DESCRIPTION>
<< inside && the description tag <<
</DESCRIPTION>
</DATA_RECORD>
Temporary solution ->
I figured out that XML Norms <
should not be in the xml, so I will use contents.toString().replaceAll("<<", "<").replaceAll("&&", "&")
To me it looks like you have an encoding problem with this line.
<< inside && the description tag <<
should either be
<< inside && the description tag <<
or it should be
< inside & the description tag <
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With