Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in p:unescape-markup with tagsoup #75

ndw opened this issue Feb 14, 2013 · 1 comment

NPE in p:unescape-markup with tagsoup #75

ndw opened this issue Feb 14, 2013 · 1 comment


Copy link

@ndw 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.

Copy link
Owner Author

@ndw 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.