Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:for-each select="//constants/constant" >
- <xsl:variable >
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="select">
- <xsl:value-of select="@value"/>
- </xsl:attribute>
- </xsl:variable>
- </xsl:for-each>
- xsl:namespace-alias
- <v name="myVarName">myValue</v>
- <resgroup id="constants" >
- <resbundle>
- <res id="var1">var1Value</res>
- </resbundle>
- <resbundle>
- <res id="var2">var2Value</res>
- </resbundle>
- </resgroup>
- <resgroup id="constants" >
- <resbundle>
- <res id="var1">var1Value</res>
- </resbundle>
- <resbundle>
- <res id="var2">var2Value</res>
- </resbundle>
- </resgroup>
- <xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:metaxsl="my:metaxsl"
- exclude-result-prefixes="metaxsl"
- <xsl:namespace-alias result-prefix="xsl" stylesheet-prefix="metaxsl" />
- <xsl:template name="BuildInstantiateConstantsTemplate_tmpl">
- <metaxsl:template match="/" name="instantiateConstants_tmpl">
- <metaxsl:template>
- <xsl:for-each select="//resgroup[@id='constants']/resbundle/res">
- <metaxsl:variable>
- <xsl:attribute name="name">
- <xsl:value-of select="@id" />
- </xsl:attribute>
- <xsl:attribute name="select">
- <xsl:value-of select="text()" />
- </xsl:attribute>
- </metaxsl:variable>
- </xsl:for-each>
- </metaxsl:template>
- </metaxsl:template>
- </xsl:template>
- <xsl:template match="/">
- <xsl:call-template name="BuildInstantiateConstantsTemplate_tmpl" />
- </xsl:template>
Add Comment
Please, Sign In to add comment