- From: Christopher Ball <christopher.r.ball@gmail.com>
- Date: Tue, 20 Apr 2010 21:19:34 -0400
- To: <xproc-dev@w3.org>
- Message-ID: <008d01cae0f0$b4db6350$0301a8c0@cgifederal.com>
Hello,
I am trying to process some zipped text files in xproc (leveraging a
Calabash extension), but I am getting tripped up by base64 encoding.
My first draft of the xproc is below. Unfortunately, the content-type option
on cx:unzip seems to be getting ignored and I end up with an output file of
the following nature:
<!-- Output Snippet -->
<c:data xmlns:c="http://www.w3.org/ns/xproc-step" name="InputFile1.txt"
content-type="">LS0tLS1CRUdJTiBQUklWQUNZLUVOSEFOQ0VEIE1FU1NBR0UtLS0tLQ0KUHJv
Yy1UeXBlOiAyMDAx . . . </c:data>
I am I missing the obvious . . . or trying to do the impossible?
Most grateful for any feedback,
Christopher
<!-- xProc File -->
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:html="http://www.w3.org/1999/xhtml"
name="aMeaninglessName"
version="1.0" >
<p:input port="source">
<p:empty/>
</p:input>
<p:declare-step type="cx:unzip" version="1.0">
<p:output port="result"/>
<p:option name="href" required="true"/>
<p:option name="file"/>
<p:option name="content-type"/>
</p:declare-step>
<p:variable name="startingFileNumber" select="'1'"/>
<p:variable name="endingFileNumber" select="'1'"/>
<p:variable name="source-folder" select="'../zippedFiles/'"/>
<p:directory-list>
<p:with-option name="path" select="$source-folder">
<p:empty/>
</p:with-option>
</p:directory-list>
<p:for-each name="ZipedHTMLFile">
<p:iteration-source
select="//c:file[position() ge number($startingFileNumber) and
position() le number($endingFileNumber)]"/>
<p:variable name="filename" select="c:file/@name"/>
<!-- Load from Zip file -->
<cx:unzip name="get-XML">
<p:with-option name="href"
select="concat($source-folder,$filename)"/>
<p:with-option name="file"
select="replace($filename,'.zip','.txt')"/>
<p:with-option name="content-type" select="text/plain"/>
</cx:unzip>
<p:store href="../output/processed.xml" name="store"/>
</p:for-each>
</p:declare-step>
Received on Wednesday, 21 April 2010 01:23:28 UTC