- From: Natan Cox <natan.cox@gmail.com>
- Date: Mon, 15 Mar 2010 20:25:17 +0100
- To: Norman Walsh <ndw@nwalsh.com>
- Cc: XProc Dev <xproc-dev@w3.org>
- Message-ID: <28f8eb9d1003151225t1dfe052dxd6a8fc0626a0173a@mail.gmail.com>
Hmmm, unfortunately I don't have 2-month-old-non-working-code lying around
here.
Thanks for trying,
Natan
On Wed, Mar 10, 2010 at 5:13 PM, Norman Walsh <ndw@nwalsh.com> wrote:
> Natan Cox <natan.cox@gmail.com> writes:
> [...]
> > 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>
> > <html> <body> <ul> ... query here ... </ul>
> </body> </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.
>
> I would, but I can't reproduce your error. This works for me:
>
> <p:declare-step version='1.0' xmlns:p="http://www.w3.org/ns/xproc"
> name="main"
> xmlns:cx="http://xmlcalabash.com/ns/extensions"
> xmlns:c="http://www.w3.org/ns/xproc-step">
>
> <p:output port="result"/>
>
> <p:xquery >
> <p:input port="source"><p:empty/></p:input>
> <p:input port="query">
> <p:inline>
> <c:data>
> <html> <body> <ul> ... query here ... </ul>
> </body> </html>
> </c:data>
> </p:inline>
> </p:input>
> <p:input port="parameters">
> <p:empty/>
> </p:input>
> </p:xquery>
>
> </p:declare-step>
>
> Can you send me a pipeline that exhibits the problem?
>
> Be seeing you,
> norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | In matters of style, swim with the
> http://nwalsh.com/ | current; in matters of principle, stand
> | like a rock.--Thomas Jefferson
>
Received on Monday, 15 March 2010 19:25:50 UTC