Hello all,
 
I am trying to parse an XML file using Saxon (free edition). After I got the below error I checked the XML file being parsed and it is well formed XML... How do I resolve this error? Thanks...
 
This is the error message I am getting→
 
Caused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; Pre
mature end of file.
        at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:425)
        at net.sf.saxon.event.Sender.send(Sender.java:178)
        at net.sf.saxon.Configuration.buildDocument(Configuration.java:3516)
        at net.sf.saxon.Configuration.buildDocument(Configuration.java:3462)
        at net.sf.saxon.query.StaticQueryContext.buildDocument(StaticQueryContex
t.java:321)
        at com.anya.crawler.runtime.processors.XQueryProcessor.castSimpleValue(X
QueryProcessor.java:171)
        at com.anya.crawler.runtime.processors.XQueryProcessor.execute(XQueryPro
cessor.java:147)
        ... 16 more
Caused by: org.xml.sax.SAXParseException; Premature end of file.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
 
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
 Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
ce)
        at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:405)
        ... 22 more
 
 
 
Yours sincerely,
Arvind.