Advertisement
dcramer

xproc p:error

Dec 23rd, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.90 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <p:declare-step version="1.0"
  4.  xmlns:p="http://www.w3.org/ns/xproc"
  5.  name="main">
  6.  
  7.   <p:input port="source" /> <!--sequence="false" primary="true"-->
  8.   <p:input port="schema" sequence="true" >
  9.     <p:document  href="http://docs-beta.rackspace.com/oxygen/13.1/mac/author/frameworks/rackbook/5.0/rng/rackbook.rng"/>
  10.   </p:input>
  11.  
  12.   <p:output port="result" primary="true">  
  13.     <p:pipe step="tryvalidation" port="result"/>  
  14.   </p:output>  
  15.   <p:output port="report" sequence="true">  
  16.     <p:pipe step="tryvalidation" port="report"/>  
  17.   </p:output>
  18.  
  19.   <p:try name="tryvalidation">
  20.     <p:group>
  21.       <p:output port="result">
  22.         <p:pipe step="xmlvalidate" port="result"/>
  23.       </p:output>
  24.       <p:output port="report" sequence="true">
  25.         <p:empty/>
  26.       </p:output>      
  27.      
  28.       <p:validate-with-relax-ng name="xmlvalidate">
  29.         <p:input port="source">
  30.           <p:pipe step="main" port="source"/>
  31.         </p:input>
  32.         <p:input port="schema">
  33.           <p:pipe step="main" port="schema"/>  
  34.         </p:input>  
  35.       </p:validate-with-relax-ng>  
  36.      
  37.     </p:group>  
  38.     <p:catch name="catch">  
  39.       <p:output port="result">  
  40.         <p:pipe step="main" port="source"/>  
  41.       </p:output>  
  42.       <p:output port="report">  
  43.         <p:pipe step="id" port="result"/>
  44.       </p:output>  
  45.       <p:error name="relaxng-validation-error" code="rax:E001" xmlns:rax="http://docs.rackspace.com/api">
  46.         <p:input port="source">
  47.           <p:inline><message>This document is invalid. No docs for you!</message></p:inline>
  48.         </p:input>
  49.         <p:log port="result" />
  50.       </p:error>
  51.       <p:identity name="id">  
  52.         <p:input port="source">  
  53.           <p:pipe step="catch" port="error"/>  
  54.         </p:input>  
  55.       </p:identity>
  56.     </p:catch>  
  57.   </p:try>
  58.  
  59. </p:declare-step>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement