source: cats/shared/urn.org.isocat.sloot/trunk/tools/resolve-dpml-args.xsl @ 3521

Last change on this file since 3521 was 3521, checked in by andmor, 11 years ago

Added sloot.dpml.resolve-arguments endpoint to resolve the dpml arguments.

File size: 1.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sloot="http://www.isocat.org/ns/sloot">
3    <xsl:param name="debug" select="false()"/>
4    <xsl:template match="@*|node()">
5        <xsl:copy>
6            <xsl:apply-templates select="@*|node()"/>
7        </xsl:copy>
8    </xsl:template>
9    <!-- skip over sloot-operator, which is this DPML script -->
10    <xsl:template match="sloot-operator" priority="1"/>
11    <xsl:template match="arguments/*">
12        <xsl:copy>
13            <xsl:apply-templates select="@*"/>
14            <xsl:variable name="val" select="unparsed-text(.)"/>
15            <xsl:if test="$debug">
16                <xsl:message>DBG: <xsl:value-of select="name()"/>[<xsl:value-of select="."/>][<xsl:value-of select="$val"/>]</xsl:message>
17            </xsl:if>
18            <xsl:choose>
19                <!-- snif if the value is XML -->
20                <xsl:when test="matches(normalize-space($val),'&lt;.*&gt;')">
21                    <xsl:copy-of select="doc(.)"/>
22                </xsl:when>
23                <xsl:otherwise>
24                    <xsl:copy-of select="$val"/>
25                </xsl:otherwise>
26            </xsl:choose>
27        </xsl:copy>
28    </xsl:template>
29</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.