<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:iris="http://iris-database.org/iris"
xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="xsl str">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:iris="http://iris-database.org/iris"
xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="xsl str">
......
<xsl:choose>
<!-- For XLAN -->
<xsl:when test="function-available('str:tokenize')">
<xsl:for-each select="str:tokenize(.,' ')">
<xsl:variable name="currentType" select="."/>
<xsl:if test=".!='999'">
<iris:instrumentType><xsl:value-of select="$ddDoc/IRIS_Data_Dict/instrument/typeOfInstruments//type/@label[../@value=$currentType]"/></iris:instrumentType>
</xsl:if>
<xsl:if test=".='999'">
<iris:instrumentType><xsl:value-of select="$newType"/></iris:instrumentType>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:when test="function-available('str:tokenize')">
<xsl:for-each select="str:tokenize(.,' ')">
<xsl:variable name="currentType" select="."/>
<xsl:if test=".!='999'">
<iris:instrumentType><xsl:value-of select="$ddDoc/IRIS_Data_Dict/instrument/typeOfInstruments//type/@label[../@value=$currentType]"/></iris:instrumentType>
</xsl:if>
<xsl:if test=".='999'">
<iris:instrumentType><xsl:value-of select="$newType"/></iris:instrumentType>
</xsl:if>
</xsl:for-each>
</xsl:when>
<!-- For SAXON -->
<xsl:otherwise>
<xsl:for-each select="tokenize(.,' ')">
<xsl:variable name="currentType" select="."/>
<xsl:if test=".!='999'">
<iris:instrumentType><xsl:value-of select="$ddDoc/IRIS_Data_Dict/instrument/typeOfInstruments//type/@label[../@value=$currentType]"/></iris:instrumentType>
</xsl:if>
<xsl:if test=".='999'">
<iris:instrumentType><xsl:value-of select="$newType"/></iris:instrumentType>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:otherwise>
<xsl:for-each select="tokenize(.,' ')">
<xsl:variable name="currentType" select="."/>
<xsl:if test=".!='999'">
<iris:instrumentType><xsl:value-of select="$ddDoc/IRIS_Data_Dict/instrument/typeOfInstruments//type/@label[../@value=$currentType]"/></iris:instrumentType>
</xsl:if>
<xsl:if test=".='999'">
<iris:instrumentType><xsl:value-of select="$newType"/></iris:instrumentType>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
No comments:
Post a Comment