Skip to content

Commit

Permalink
[xprocspec] Support '!/'-style paths to files inside ZIPs
Browse files Browse the repository at this point in the history
  • Loading branch information
bertfrees committed Feb 22, 2017
1 parent 7efd50b commit 4b99030
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@
<p:sink/>

<p:choose>
<p:when test="contains($href, '!/')">
<pxi:message>
<p:input port="source">
<p:inline>
<doc/>
</p:inline>
</p:input>
<p:with-option name="message" select="replace($href, '^([^!]+)!/(.+)$', 'loading $2 from ZIP $1')"/>
<p:with-option name="logfile" select="$logfile">
<p:empty/>
</p:with-option>
</pxi:message>
<p:sink/>
<cx:unzip>
<!--
note that "file" needs to be specified before "href" because otherwise $href
variable in select part is affected
-->
<p:with-option name="file" select="replace($href, '^([^!]+)!/(.+)$', '$2')"/>
<p:with-option name="href" select="replace($href, '^([^!]+)!/(.+)$', '$1')"/>
</cx:unzip>
</p:when>

<!-- Force HTML -->
<p:when test="$method='html'">
<pxi:html-load>
Expand Down

0 comments on commit 4b99030

Please sign in to comment.