This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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"/>
	</xsl:if>
</xsl:template>

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@lotus.com [mailto:Paul_Dick@lotus.com]
: Sent: Friday, September 08, 2000 7:51 AM
: To: xsl-list@mulberrytech.com
: 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:  http://www.mulberrytech.com/xsl/xsl-list
: 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]