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

looping through a lookup table

Subject: looping through a lookup table
From: Ann Marie Rubin <Annmarie.Rubin@xxxxxxx>
Date: Mon, 15 Nov 2004 10:59:33 -0500
xsl looping
Hello List,

This stylesheet uses a static lookup table to define element attributes
that need to be updated.  search-local-classes-first="ORANGES" and
include-war-manifest-class-path="APPLES" out output as attributes of the
orion-web-app element AND the web-app-classloader element. They are
attributes of the web-app-class-loader element and should only be output
in the result tree for that element.

How do I get this to work?

thanks,

Ann Marie


<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:lookup="my:lookup"
  exclude-result-prefixes="lookup">
 
  <lookup:element>
     <orion-web-app temporary-directory="/var/temp"
                    deployment-version="10.0"
                    ROSE="RED"/>
     <web-app-class-loader search-local-classes-first="ORANGES"
                           include-war-manifest-class-path="APPLES"/>
   </lookup:element>

   <xsl:template match="node()">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
 
  <xsl:template match="@*">
 <xsl:copy-of select="."/>
   
  <xsl:choose>
   <xsl:when test="'orion-web-app'=name(parent::*)">  
   <xsl:copy-of select="document('')/*/lookup:element/orion-web-app/@*
                                  [name() = name(current())]"/>
 </xsl:when>
 </xsl:choose>
 
 <xsl:choose>
  <xsl:when test="'web-app-class-loader'=name(parent::*)">  
 <xsl:copy-of
select="document('')/*/lookup:element/orion-web-app/web-app-class-loader/@*
                                  [name() = name(current())]"/>
 </xsl:when>
 </xsl:choose>
   
                                   
  <xsl:choose>
       <xsl:when test="not(//@*=ROSE) and 'orion-web-app'=name(parent::*)">
             <xsl:copy-of select="document('')/*/lookup:element/*/@*"/>  
       </xsl:when>
  </xsl:choose>

   
      </xsl:template>
</xsl:stylesheet>

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.