Re: p:error

Norman Walsh wrote:
> / Rui Lopes <rlopes@di.fc.ul.pt> was heard to say:
> | We should keep the code as required, otherwise how could a pipeline author
> | perform a p:choose on /err:errors/err:error/@code ?
> 
> I'm not talking about err:error, but p:error, the user-level step that
> causes an error. In particular:
> 
> <p:choose name="version">
>   <p:when test="/*[@version = 2]">
>     <p:validate-xml-schema>
>       <p:input port="schema">
> 	<p:document href="v2schema.xsd"/>
>       </p:input>
>     </p:validate-xml-schema>
>   </p:when>
> 
>   <p:when test="/*[@version = 1]">
>     <p:validate-xml-schema>
>       <p:input port="schema">
> 	<p:document href="v1schema.xsd"/>
>       </p:input>
>     </p:validate-xml-schema>
>   </p:when>
> 
>   <p:when test="/*[@version]">
>     <p:identity/>
>   </p:when>
> 
>   <p:otherwise>
>     <p:error description="Required version attribute missing."/>
>   </p:otherwise>
> </p:choose>
> 
> There's no value in forcing me to put a code there. Nor a description,
> if it comes to that. Users will just use code="" and description=""
> if they have to, and that's no more useful than making them optional.

I agree with you on that. My only concern is, for instance, imagine you 
wrap that p:choose on a pipeline library and I want to use it in my 
pipeline. If I do a p:try/p:catch on calling your pipeline, I will have 
some trouble distinguishing your error from, let's say, another error 
generated by one of the p:validate-xml-schema steps.

Should we leave those cases outide of XProc's scope, as best practices 
(i.e., identifying errors with @code)?

Rui

Received on Tuesday, 3 July 2007 12:37:27 UTC