RE: Matching attributes that contain both &pos; and "

Subject: RE: Matching attributes that contain both &pos; and "
From: "Kaganovich, Yevgeniy (Eugene)" <ykaganovich@xxxxxxxxxxx>
Date: Fri, 8 Sep 2000 13:16:57 -0700
Sorry, didn't pay attention to where the expression was. Rookie mistake.

This seems to me like an arbitrary restriction in the spec. I understand
that it doesn't really limit any functionality as there is enough
flexibility in the language to work around it, but what is the reason why
variables are not allowed inside a match? 

I've seen the "replace" solution before. I understand why it works, but it
just looks ugly (no offence, David :) I'm now wondering if the original
problem can be rewritten this using a select. (Of course, this isn't the
prettiest thing I've ever seen either)

<xsl:template match="channel/location"/>
	<xsl:variable name="my_name"> "x" 'a z</xsl:variable>
	<xsl:if select="@name=$my_name">
		<xsl:value-of select="@name"/>

Is it true in general case that <xsl:template match="expr1"> can always be
separated into <xsl:template match="expr1"><xsl:if select="expr2"> ... ? Is
this a BAD thing to do?

- Eugene

: -----Original Message-----
: From: Paul_Dick@xxxxxxxxx [mailto:Paul_Dick@xxxxxxxxx]
: Sent: Friday, September 08, 2000 7:51 AM
: To: xsl-list@xxxxxxxxxxxxxxxx
: Subject: Re: Matching attributes that contain both &pos; and &quot;
: David writes:
: >but you can do match="xxx[.=concat('&quot;',&quot;'&quot;)]"
: Yes,  the working template is a bear to decipher,  but it does work.
: ---XML Source ---
: <channel>
:   <location name=' "x"  &apos;a z'/>
: </channel>
: ---XSLT ---
: <xsl:template match="channel/location[@name=concat(' 
: &quot;x&quot; ',&quot;
: &apos;a z&quot;)]">
:   <xsl:value-of select="@name"/>
: </xsl:template>
: Paul
:  XSL-List info and archive:

 XSL-List info and archive:

Current Thread