This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
check if a* not equal to attribute value
- From: "Bryan Rasmussen" <bry at itnisk dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 31 Jan 2002 10:37:43 +0100
- Subject: [xsl] check if a* not equal to attribute value
- Keywords: xsltDEV
- Reply-to: xsl-list at lists dot mulberrytech dot com
I posted on this before, it got bounced cause I used Help in the subject,
supposedly administrator is forwarding the post but I decided I could better
describe what my problem is in this one:
1. I have a node with a bunch of attributes, a* if any of these attributes
names are not the same as the value of the attribute name in some xpath then
I want to copy them over to my result tree.
currently what I have, which is working, is the following:
<xsl:template match="fo:*[@it:class]" priority="2">
<xsl:variable name="itclass"><xsl:value-of
select="@it:class"/></xsl:variable>
<xsl:element name="{name()}">
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:for-each select="$cssdocSelect//selector[@it:class=$itclass]/s">
<xsl:attribute name="{@name}"><xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
I think this will break on some processors, right, or give me at least the
opposite of what I want, dependant on processing
order. interesting question: does anyone know of a processor in which this
would give the opposite of what I want?
anyway the question is how to find out if any @* name is not equal to
$cssdocSelect//selector[@it:class=$itclass]/s[@name]
I'm thinking maybe it can't be done, and instead I should compare values,
but then I lose generic value I think.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list