Changeset 26009
- Timestamp:
- 2012-07-24T11:10:57+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/core/transform/preProcess.xsl
r25880 r26009 54 54 55 55 56 <!-- produce an exact copy of the current node, but expand and replace all elements belonging to the gslib namespace. -->56 <!-- produce an exact copy of the current node, but expand and replace all elements belonging to the gslib/gsvar namespaces. --> 57 57 <xsl:template name="expand_gslib_elements"> 58 58 … … 60 60 <xsl:for-each select="*|text()"> 61 61 <xsl:choose> 62 62 <!-- variables --> 63 63 <xsl:when test="namespace-uri(.)=namespace::gsvar"> 64 64 <xsl:element name="xsl:value-of"> … … 66 66 </xsl:element> 67 67 </xsl:when> 68 <!-- if node has gslib prefix, expand it into appropriate copy-of or call-template element --> 69 <xsl:when test="namespace-uri(.)=namespace::gslib"> 70 68 <!-- templates --> 69 <xsl:when test="namespace-uri(.)=namespace::gslib"> 71 70 <xsl:variable name="name" select="local-name()"/> 72 <xsl:choose>73 74 <!-- if library contains a variable of this name, expand to it's value -->75 <xsl:when test="/skinAndLibraryXsl/libraryXsl//xsl:variable[@name = $name]">76 <xsl:element name="xsl:copy-of">77 <xsl:attribute name="select">$<xsl:value-of select="local-name()" /></xsl:attribute>78 </xsl:element>79 </xsl:when>80 81 82 <!-- if library contains a template of this name, expand to a call-template and pass attributes as parameters -->83 <xsl:otherwise>84 71 <xsl:element name="xsl:call-template"> 85 72 <xsl:attribute name="name"> <xsl:value-of select="local-name()" /></xsl:attribute> … … 92 79 </xsl:for-each> 93 80 </xsl:element> 94 </xsl:otherwise>95 96 </xsl:choose>97 81 </xsl:when> 98 82
Note:
See TracChangeset
for help on using the changeset viewer.