chris
chris

Reputation: 600

SAXParseException with XQJ and eXist

I have a problem with the XQJ API and eXist. Whenever I try to query my files inside the eXist db I get an

XQJTO013 - org.xml.sax.SAXParseException; lineNumber: 928; columnNumber: 354; The reference to entity "quotDer" must end with the ';' delimiter.

and several other delimiter exceptions throughout the document, whenever " was used ( & doesn´t raise errors btw.).

Inside the document however the ";" is set behind the &quot, when I query the file with the eXist GUI Query Dialog it works. When I query the file over the XQJ API inside the baseX db no problem either.

I tried to change the SAX Parser from Saxon to Xerces and at last to Oracle the error is raised with each of these.

My question is, is there a bug in the XQJ eXist implementation or am I missing something, hope you can help me out.

I have the lib of exist-xqj-api-1.0.1 on my classpath.


Here some code for simple reproduction

public static void main(String[] args) {

    XQDataSource xqs = new ExistXQDataSource();

    try {
        xqs.setProperty("serverName", "localhost");

        xqs.setProperty("port", "8080");
        XQConnection conn = xqs.getConnection("admin", "admin");

        XQPreparedExpression xqpe = conn.prepareExpression("element test {'"bla"'}"); 

        XQResultSequence rs = xqpe.executeQuery();
        rs.writeSequence(System.out, new Properties()); // SAXParseException is raised here

        conn.close();   

    } catch (XQException e) {
        e.printStackTrace();
    }

}

Upvotes: 0

Views: 383

Answers (1)

Charles Foster
Charles Foster

Reputation: 61

Can you create a small, isolated example, which can be reproduced?

e.g. Submitting a small XQuery which produces XML that then results in this error. A document may not necessarily need to exist in the Database.

If you are able to do this, please raise it as an issue on the XQJ.NET issue tracker [1].

Regards,

Charles

[1] http://xqj.net/issues/

Upvotes: 1

Related Questions