Changeset 5ac9ea9
- Timestamp:
- 13/04/2012 18:42:32 (10 years ago)
- Branches:
- master
- Children:
- 01a6690
- Parents:
- 0e7bdd1
- git-author:
- Eric van der Vlist <vdv@dyomedea.com> (13/04/2012 18:42:32)
- git-committer:
- Eric van der Vlist <vdv@dyomedea.com> (13/04/2012 18:42:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
archiver/pipelines/actions/package-archive.xpl
r0e7bdd1 r5ac9ea9 203 203 <xsl:apply-templates select="/archive/response" mode="warc"/> 204 204 <CRLF/> 205 205 206 206 </xsl:variable> 207 207 <document xsl:version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string" content-type="text/plain"> … … 226 226 <p:input name="data" href="#document#xpointer(/archive/response/document)"/> 227 227 </p:processor> 228 228 229 <p:choose href="current()"> 230 <p:when test="/archive/@href-rewritten"> 231 <p:processor name="oxf:identity"> 232 <p:input name="data"> 233 <none/> 234 </p:input> 235 <p:output name="data" id="file" debug="file"/> 236 </p:processor> 237 </p:when> 238 <p:otherwise> 239 <!-- Store a copy of the orginal version --> 240 <p:processor name="oxf:file-serializer"> 241 <p:input name="config"> 242 <config> 243 <scope>request</scope> 244 </config> 245 </p:input> 246 <p:input name="data" href="#document#xpointer(/archive/response/document)"/> 247 <p:output name="data" id="file" debug="file"/> 248 </p:processor> 249 </p:otherwise> 250 </p:choose> 251 252 253 229 254 <p:processor name="oxf:identity"> 230 <p:input name="data" href=" current()"/>255 <p:input name="data" href="aggregate('file', current(), #file)"/> 231 256 <p:output name="data" ref="files"/> 232 257 </p:processor> … … 236 261 237 262 <p:processor name="oxf:null-serializer"> 238 <p:input name="data" href="#files" />263 <p:input name="data" href="#files" debug="files"/> 239 264 </p:processor> 240 265 241 266 <p:processor name="oxf:zip"> 242 <p:input name="data" transform="oxf: xslt" href="#warc">267 <p:input name="data" transform="oxf:unsafe-xslt" href="aggregate('root', #warc, #files)"> 243 268 <files xsl:version="2.0" file-name="archive.zip"> 244 269 <file name="archive.warc"> 245 <xsl:value-of select="/ url"/>270 <xsl:value-of select="/root/url"/> 246 271 </file> 272 <xsl:for-each select="/root/files/file[url]"> 273 <xsl:variable name="tokens" select="tokenize(archive/@url, '/')"/> 274 <xsl:variable name="last-token" select="$tokens[last()]"/> 275 <xsl:variable name="tokens2" select="tokenize($last-token, '\.')"/> 276 <xsl:variable name="extension" select="$tokens2[last()]"/> 277 <file name="rewritten/{saxon:string-to-hexBinary(substring(archive/@url, 1, string-length(archive/@url) - string-length($extension) - 1), 'utf-8')}.{$extension}"> 278 <xsl:value-of select="url"/> 279 </file> 280 </xsl:for-each> 247 281 </files> 248 282 </p:input>
Note: See TracChangeset
for help on using the changeset viewer.