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

c:errors does not contain a c:error in p:catch #97

Closed
josteinaj opened this Issue Apr 30, 2013 · 0 comments

Comments

Projects
None yet
2 participants
@josteinaj
Contributor

josteinaj commented Apr 30, 2013

This pipeline:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">

    <p:output port="result"/>

    <p:try>
        <p:group>
            <p:unwrap match="/*">
                <p:input port="source">
                    <p:inline>
                        <doc>
                            <child/>
                            <child/>
                        </doc>
                    </p:inline>
                </p:input>
            </p:unwrap>
        </p:group>
        <p:catch name="catch">
            <p:identity>
                <p:input port="source">
                    <p:pipe port="error" step="catch"/>
                </p:input>
            </p:identity>
        </p:catch>
    </p:try>

</p:declare-step>

returns this with Calabash 1.0.9:

<c:errors xmlns:c="http://www.w3.org/ns/xproc-step"/>

but this is returned with Calumet (1.0.13.r1107066):

<c:errors xmlns:c="http://www.w3.org/ns/xproc-step"><c:error code="err:XD0001" name="!1.2.1.1" type="p:unwrap" xmlns:p="http://www.w3.org/ns/xproc" xmlns:err="http://www.w3.org/ns/xproc-error">{http://www.w3.org/ns/xproc-error}XD0001: It is a dynamic error if a non-XML resource is produced on a step output or arrives on a step input.

Step   : !1.2.1.1 {http://www.w3.org/ns/xproc}unwrap
Href   : file:/home/jostein/try-catch.xpl
Path   : /p:declare-step/p:try[1]/p:group[1]/p:unwrap[1]

Caused by:
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. 
</c:error></c:errors>

The most useful bit is the error code of the c:error child element which allows you to for instance handle different kinds of errors in one p:catch or include the error code in some validation report to the end-user.

ndw added a commit that referenced this issue Jul 30, 2013

Attempt to work around issue #97 by dealing with exceptions that aren…
…'t caught by the error listener; its better but could probably still be improved

ndw added a commit that referenced this issue Jul 30, 2013

Attempt to work around issue #97 by dealing with exceptions that aren…
…'t caught by the error listener; its better but could probably still be improved

@ndw ndw closed this Aug 3, 2013

@rdeltour rdeltour referenced this issue Apr 24, 2014

Closed

Integration of XProcSpec testing #7

12 of 14 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment