W3C home > Mailing lists > Public > xproc-dev@w3.org > January 2010

Calabash NullPointerExceptions

From: Natan Cox <natan.cox@gmail.com>
Date: Fri, 8 Jan 2010 08:34:37 +0100
Message-ID: <28f8eb9d1001072334i2437df1eg19345f661bc72b3c@mail.gmail.com>
To: xproc-dev@w3.org
Hi Norman,

I was having some trouble getting a certain XProc step to work. Mainly my
fault because I did something like

  <p:xquery >
    <p:input port="query">
          &lt;html> &lt;body> &lt;ul> ... query here ... &lt;/ul> &lt;/body>
    <p:input port="parameters" sequence="true">

forgetting c:query in the p:inline.

I get a NullPointerException on node.getBaseURI()

            S9apiUtils.writeXdmValue(runtime, nodes, dest,

It would easier for me if in ReadableInline you would add after

        // Find the document element so we can get the base URI
        XdmNode node = null;
        for (int pos = 0; pos < nodes.size() && node == null; pos++) {
            if (((XdmNode) nodes.get(pos)).getNodeKind() ==
XdmNodeKind.ELEMENT) {
                node = (XdmNode) nodes.get(pos);

another null check on node and report a nice contextualized message of what
I did wrong.

Thanks, Natan
Received on Friday, 8 January 2010 17:15:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:06 UTC