[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

merging two templates with starts-with same name

Subject: merging two templates with starts-with same name
From: "Braumüller, Hans" <H.Braumueller@xxxxxxxxxxxx>
Date: Tue, 29 Apr 2003 11:37:44 +0200
the two template in access
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.