Paradox Convention 2003 |
Paradox and XML |
|
XML Transforms: XSLT (2)
- XSLT "templates" can be used to breakdown the code hierarchically as a set
of nested matching rules, just like procedure and function calls are used
for the same purpose in imperative (sequential) langages like Pascal, Java
or ObjectPAL
<xsl:template name="showMessage">
<xsl:param name="message">Message inconnu</xsl:param>
<xsl:value-of select="substring-after($message, ':')" />:
<dl>
<xsl:for-each select=
"/wsdl:definitions/wsdl:message[@name=substring-after($message, ':')]/wsdl:part" >
<dt><xsl:value-of select="@name" /></dt>
<dd><xsl:value-of select="substring-after(@type, ':')" /></dd>
</xsl:for-each>
</dl>
</xsl:template>
Note that expressions in the select
attribute of XSLT cnstructs
are XPath expressions.
In spite of the peculiarities of functional programming and the XML-based
syntax, a bit uneasy at first, most control structures from traditional 3GLs
are available, like the for
loop highlighted in this example,
that iterates over the results of an XPath selection