bb*******@lycos.de wrote:
I am not sure which XSLT processor will be used.
The transformation will be integreated in a existing system. I think
it is saxon 8.?
Well there are different versions of Saxon 8 supporting different
version of the XSLT 2.0 draft but with Saxon 8.9 or 9.0 which support
the final XSLT 2.0 specification you could easily use the tokenize
function to split up a string value passed in into a sequence of strings:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="types" as="xs:string"/>
<xsl:variable name="type-list" as="xs:string*"
select="tokenize($types, ',')"/>
<xsl:template match="root">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="entry[@type = $type-list]"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Then you could use Saxon 9 from the command line as follows:
java -jar saxon9.jar -s:input.xml -xsl:stylesheet.xsl types=a,b
--
Martin Honnen
http://JavaScript.FAQTs.com/