|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] merging two templates with starts-with same name
Hello friends,
small problem but i cannot get the solution
i have two similar templates:
<xsl:template match="refDB1" mode="refDB">
<xsl:param name="refDB"/>
<xsl:choose>
<xsl:when test="normalize-space($refDB) != '' "><xsl:value-of select="$refDB"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="refDB2" mode="refDB">
<xsl:param name="refDB" />
<xsl:choose>
<xsl:when test="normalize-space($refDB) != '' "><xsl:value-of select="$refDB"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:template>
i am trying to do one for all nodes that starts-with refDB like pseudo-code:
<xsl:template match="*[name() = starts-with(refDB, *)]" mode="refDB">
<xsl:param name="refDB" />
<xsl:choose>
<xsl:when test="normalize-space($refDB) != '' "><xsl:value-of select="$refDB"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:template>
As second optimization i am trying to figure out how i can select a variable instead a to pass a parameter with the selecting node, because i am matching node refDB1 on my properties.xml (over document() ) so i know that name to select it igual on my source.xml, where if it is empty or not exists, i output the value of my properties.xml.
Thanks,
Hans Braumüller
-- + --
Mail Art Not War
http://crosses.net
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








