R
Rico
The following piece of code :
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(filename);
ends in "Document root element is missing" for the following XML:
<?xml version="1.0" encoding="utf-8"?>
<EmailSender>
<db_name>master</db_name>
<document_type>document_New</document_type>
<emailID />
<document_ID>23983</document_ID>
</EmailSender>
I don't really know how the XML is being produced but a space between the
last double-quote and the last '?' seems to solve the problem.
So does changing double-quotes to single-quotes.
Is it something wrong with the XML document or am I missing something
about the usage of the API ?
Thanks. Regards,
Rico.
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(filename);
ends in "Document root element is missing" for the following XML:
<?xml version="1.0" encoding="utf-8"?>
<EmailSender>
<db_name>master</db_name>
<document_type>document_New</document_type>
<emailID />
<document_ID>23983</document_ID>
</EmailSender>
I don't really know how the XML is being produced but a space between the
last double-quote and the last '?' seems to solve the problem.
So does changing double-quotes to single-quotes.
Is it something wrong with the XML document or am I missing something
about the usage of the API ?
Thanks. Regards,
Rico.