|
Subject: XSLT Spec Problem From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx> Date: Sat, 24 Jul 1999 11:15:51 -0400 |
When using parameters with template matches, the parameters only last during
the first match made. For example:
<DIV>
<P>
<SPAN>
<xsl:template match="DIV">
<xsl:apply-templates select="*>
<xsl:param name="label">true</xsl:param>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="SPAN">
<xsl:param-variable name="label">false</xsl:param-variable>
....
</xsl:template>
This would work as written. Now suppose somebody comes along an adds a match
for <P>
<xsl:template match="P">
</xsl:template>
This breaks the stylesheet because the parameters are lost.
Doesn't this make stylesheets containing parameters very fragile to change?
Any one making a change must carefully understand all use of parameters
before making the slightest change to the sheet. In this case the <P> match
needs to be modified to pass the label parameter along, but what if there
were more combos like DIV/SPAN that the P tag would mess up? All of these
variable would have to be passed along.
Could variables be visible to all matches until the select="*" returns?
Jon Smirl
jonsmirl@xxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: HELP! XT is putting namespaces , James Clark | Thread | Re: XSLT Spec Problem, Jon Smirl |
| Re: XPath draft comments, James Clark | Date | Re: XSLT Spec Problem, Jon Smirl |
| Month |