W3C home > Mailing lists > Public > xproc-dev@w3.org > January 2010

Re: Getting Dynamically generated error message within output file in p:catch

From: Alex Muir <alex.g.muir@gmail.com>
Date: Mon, 4 Jan 2010 14:40:53 +0000
Message-ID: <88b533b91001040640v179b1439hc0776747429e58f@mail.gmail.com>
To: Toman_Vojtech@emc.com
Cc: xproc-dev@w3.org
Hi Vojtech,

I'm trying to output the dynamic exception message within a file.

The following new code derived from your feedback does output the
<c:errors xmlns:c="http://www.w3.org/ns/xproc-step"/>
however no mention of which exception occurred which ultimately what I
want to know.

If I remove the try catch and run I'll get an exception message in the
oxygen browser saying that some xml is malformed (which is as a result
of using the saxon:parse function with some bad input).

I want to get that dynamically generate error message (or any other
error message) into an output file and I'm not yet able to do that.

  <p:catch name="catch">
        <p:group name="output">

          <p:identity>
            <p:input port="source">
              <p:pipe port="error" step="catch"/>
            </p:input>
          </p:identity>

          <p:documentation> Store XML file Output </p:documentation>
          <p:store name="store">
            <p:with-option name="href" select="$fileName">
              <p:pipe step="catch" port="error"/>
            </p:with-option>
          </p:store>

          <p:documentation> Create result XML </p:documentation>
          <p:identity>
            <p:input port="source">
              <p:pipe step="store" port="result"/>
            </p:input>
          </p:identity>

        </p:group>
      </p:catch>

Regards
Alex

On Mon, Jan 4, 2010 at 7:27 AM,  <Toman_Vojtech@emc.com> wrote:
> Hi Alex,
>
> I must admit I am not entirely sure what exactly you want to do, but if
> you want to access the error message in p:catch, you can refer to the
> implicit "error" input port in p:catch. The port contains an XML
> document that represents the error: the error code and optionally other
> information such as detail message, line number etc.
>
> <p:catch name="error">
>  ...
>  <p:identity>
>    <p:pipe step="catch" port="error"/>
>  </p:identity>
>  ...
> </p:catch>
>
> Regards,
> Vojtech
>
>> -----Original Message-----
>> From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On
> Behalf Of
>> Alex Muir
>> Sent: Friday, January 01, 2010 7:50 PM
>> To: XProc Dev
>> Subject: Getting Dynamically generated error message within output
> file in p:catch
>>
>> Hi,
>>
>> I have a series of XSLT transformation steps within a try catch
>> statement. The process fails at one of the transformations and I want
>> to output within the catch, a file with it's name and a message
>> containing the error that was generated however after reading the
>> xproc specs and searching the dev list I don't see a dynamic error
>> message handling example so was hoping someone could help me out.
>>
>> Currently I'm outputting into my xml output file within the catch:
>>
>> <c:file xmlns:c="http://www.w3.org/ns/xproc-step"
>> name="8x8IncDe_CIK0001023731.html"/>
>>
>>
>>     <p:try>
>>       <p:group>
>>
>> ... XSLT transformations.
>>
>>    </p:group>
>>
>>   <p:catch>
>>         <p:group name="output">
>>
>>           <p:documentation> Store XML file Output </p:documentation>
>>           <p:identity name="out_file"/>
>>           <p:store name="store">
>>             <p:with-option name="href"
>> select="concat($exception-folder, $fileName, '.xml')">
>>               <p:pipe step="out_file" port="result"/>
>>             </p:with-option>
>>           </p:store>
>>
>>
>>           <p:documentation> Create result XML </p:documentation>
>>           <p:identity>
>>             <p:input port="source">
>>               <p:pipe step="store" port="result"/>
>>             </p:input>
>>           </p:identity>
>>
>>         </p:group>
>>       </p:catch>
>>     </p:try>
>>
>> --
>>
>> Regards and happy New Year
>>
>> Alex
>> https://sites.google.com/a/utg.edu.gm/alex
>>
>
>
>



-- 

Alex
https://sites.google.com/a/utg.edu.gm/alex
Received on Monday, 4 January 2010 14:41:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 January 2010 14:41:22 GMT