NPE in p:unescape-markup with tagsoup #75

ndw opened this Issue Feb 14, 2013 · 1 comment


None yet
1 participant

ndw commented Feb 14, 2013

Reported by George Bina:

The following pipeline causes an NPE:

<p:declare-step xmlns:p=""
    xmlns:cx="" version="1.0">
    <p:input port="source">
            <c:request method="get"
    <p:output port="result"/>
    <p:unescape-markup namespace=""

This triggers an NPE.
We investigated this and the underlying stack trace is:

com.xmlcalabash.core.XProcException: java.lang.NullPointerException
at com.xmlcalabash.library.UnescapeMarkup.tagSoup(Unknown Source)
at Source)
at Source)
at com.xmlcalabash.runtime.XPipeline.doRun(Unknown Source)
at Source)
at ro.sync.xml.transformer.xproc.calabash.XProcTransformerImpl.transform(
at ro.sync.xml.transformer.xproc.XProcTransformer$
at Source)
Caused by: java.lang.NullPointerException
at$Parser.parse(Unknown Source)
at Source)
at com.xmlcalabash.util.XProcURIResolver.resolveEntity(Unknown Source)
at org.ccil.cowan.tagsoup.Parser.push(
at org.ccil.cowan.tagsoup.Parser.rectify(
at org.ccil.cowan.tagsoup.Parser.stagc(
at org.ccil.cowan.tagsoup.HTMLScanner.scan(
at org.ccil.cowan.tagsoup.Parser.parse(
at net.sf.saxon.event.Sender.sendSAXSource(
at net.sf.saxon.event.Sender.send(
at net.sf.saxon.Configuration.buildDocument(
... 8 more

The problem seems to be that the XProcURIResolver set on the tagsoup.Parser receives a null systemId in the
resolveEntity(String publicId, String systemId)
callback and the first thing in that class is
URI baseURI = new URI(systemId);
which triggers the NPE in the URI constructor.


This comment has been minimized.

Show comment
Hide comment

ndw Feb 14, 2013


Indeed, presented with , tagsoup calls resolveEntity(null, null).


ndw commented Feb 14, 2013

Indeed, presented with , tagsoup calls resolveEntity(null, null).

ndw added a commit that referenced this issue Feb 14, 2013

@ndw ndw closed this Feb 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment