daily pastebin goal
1%
SHARE
TWEET

Controlling output files from xproc

a guest Nov 3rd, 2011 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
  3.    version="1.0">
  4.     <p:input port="source"/>
  5.    <!--  <p:output port="result" primary="true" sequence="false"/>-->
  6.     <p:output port="secondary" primary="false" sequence="true"/>
  7.    
  8.     <p:variable name="input-base" select="p:base-uri(/*)"/>
  9.     <p:variable name="output-wadl" select="p:resolve-uri('foo.xml',$input-base)"/>
  10.    
  11.     <p:validate-with-xml-schema assert-valid="true" mode="strict" name="validate">
  12.         <p:input port="schema">
  13.             <p:document  href="xsd/wadl.xsd"/>
  14.         </p:input>
  15.     </p:validate-with-xml-schema>
  16.     <p:xslt name="style" version="2.0">
  17.         <p:input port="source">
  18.             <p:pipe step="validate" port="result"/>
  19.         </p:input>
  20.         <p:input port="stylesheet">
  21.             <p:document href="xsl/normalizeWadl.xsl"/>
  22.         </p:input>
  23.         <p:input port="parameters">
  24.             <p:empty/>
  25.         </p:input>
  26.     </p:xslt>
  27.     <p:validate-with-xml-schema assert-valid="true" mode="strict" name="post-validate">
  28.         <p:input port="schema">
  29.             <p:document  href="xsd/wadl.xsd"/>
  30.         </p:input>
  31.     </p:validate-with-xml-schema>
  32.     <!-- This doesn't work. Guess you can't use AVTs in pipelines.
  33.         But how do you get it to dereference the variable?-->
  34.     <p:store href="{$output-wadl}">
  35.         <p:log port="result" href="xproc1.log"/>
  36.     </p:store>
  37.     <p:for-each>
  38.         <p:iteration-source>
  39.             <p:pipe step="style" port="secondary"/>
  40.         </p:iteration-source>
  41.         <p:store encoding="utf-8" indent="true" omit-xml-declaration="false">
  42.             <p:log port="result" href="xproc2.log"/>
  43.             <!-- This has no apparent effect. The files still land in my home dir -->
  44.             <p:with-option name="href" select="resolve-uri(base-uri(/*),$input-base)"/>
  45.         </p:store>        
  46.     </p:for-each>
  47.  
  48. </p:declare-step>
  49.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top