Calabash NullPointerExceptions

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">
      <p:inline>
          &lt;html> &lt;body> &lt;ul> ... query here ... &lt;/ul> &lt;/body>
&lt;/html>
     </p:inline>
    </p:input>
    <p:input port="parameters" sequence="true">
      <p:empty/>
    </p:input>
  </p:xquery>

forgetting c:query in the p:inline.

I get a NullPointerException on node.getBaseURI()

            S9apiUtils.writeXdmValue(runtime, nodes, dest,
node.getBaseURI());


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