Permalink
Browse files

Allow attributes (i.e. xml:id) to pass through on drop @attribute nodes

  • Loading branch information...
1 parent 80ceb35 commit 92b18cf87546163d6d2b8976bfc52f60e3c3c72d @lentinj lentinj committed May 9, 2012
Showing with 5 additions and 1 deletion.
  1. +3 −0 docs/CHANGES.txt
  2. +2 −1 lib/diazo/normalize-rules.xsl
View
@@ -4,6 +4,9 @@ Changelog
1.0.2 (unreleased)
------------------
+* Allow attributes (i.e. xml:id) to pass through on drop @attribute nodes
+ [lentinj]
+
1.0.1 (2012-05-09)
------------------
@@ -109,9 +109,10 @@
<xsl:template match="//diazo:rules/diazo:drop[@attributes and @content]">
<xsl:variable name="attributes" select="concat(' ', normalize-space(@attributes), ' ')"/>
<xsl:variable name="content" select="@content"/>
+ <xsl:variable name="node_attrs" select="@*"/>
<xsl:for-each select="str:tokenize(normalize-space(@attributes), ' ')">
<xsl:element name="diazo:drop">
- <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="$node_attrs"/>
<xsl:attribute name="content"><xsl:value-of select="$content"/><xsl:choose>
<xsl:when test="contains($attributes, ' * ')">/@*</xsl:when>
<xsl:otherwise>/@*[contains('<xsl:value-of select="$attributes"/>', concat(' ', name(), ' '))]</xsl:otherwise>

0 comments on commit 92b18cf

Please sign in to comment.