-
Notifications
You must be signed in to change notification settings - Fork 0
/
load-data.xpl
42 lines (38 loc) · 1.38 KB
/
load-data.xpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:fx="http://www.faustedition.net/ns/xproc"
type="fx:load-data" name="load-data"
xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
<p:option name="href"/>
<p:input port="source">
<p:empty/>
</p:input>
<p:output port="result"/>
<p:xslt name="prepare-request" template-name="create-request">
<p:input port="source"><p:empty/></p:input>
<p:with-param name="href" select="$href"/>
<p:input port="stylesheet"><p:inline>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:param name="href"/>
<xsl:template name="create-request">
<c:request method="GET" href="{$href}" override-content-type="text/plain"/>
</xsl:template>
</xsl:stylesheet>
</p:inline></p:input>
</p:xslt>
<p:http-request name="do-request"/>
<p:xslt name="extract-body">
<p:input port="stylesheet">
<p:inline>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<c:data>
<xsl:copy-of select="//c:body/node()"/>
</c:data>
</xsl:template>
</xsl:stylesheet>
</p:inline>
</p:input>
<p:input port="parameters"><p:empty/></p:input>
</p:xslt>
</p:declare-step>