[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: equal signs in XML attribute values

Subject: Re: equal signs in XML attribute values
From: "Steve Muench" <SMUENCH@xxxxxxxxxxxxx>
Date: 01 Dec 98 16:31:27 -0800
xml equal sign
Hi, 
 
If you're writing a template to match any element with a foo attribute 
equal to 3, which then applies the template for a bar element within 
the matching element having a foo = 3, then I got the following to work: 
 
The output of this simple example is: 
 
firstmatch secondmatch 
 
---- mydata.xml -------- 
 
<?xml version="1.0" ?> 
<?xml:stylesheet type="text/xsl" href="mystyle.xsl" ?> 
<top> 
  <something foo="3"> 
    <bar frob="firstmatch"/> 
  </something> 
  <this foo="3"> 
    <bar frob="secondmatch"/> 
  </this> 
</top> 
 
---- mystyle.xsl -------- 
 
<?xml version="1.0" ?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">  
 
<xsl:template> 
  <xsl:apply-templates/> 
</xsl:template> 
 
<xsl:template match="*[@foo = 3]">  
  <xsl:apply-templates select="bar"/>  
</xsl:template>  
 
<xsl:template match="bar"> 
<xsl:value-of match="@frob"/> 
</xsl:template> 
</xsl:stylesheet> 
 
____________________________________________________________________________ 
 Steve  | Consulting PM & XML Technology Evangelist | smuench@xxxxxxxxxx 
 Muench |      Java Business Objects Dev Team       | geocities.com/~smuench 

--- Begin Message ---
Subject: equal signs in XML attribute values
From: "Freed, Erik" <freed@xxxxxxxxxxxxxxxxxx>
Date: 01 Dec 98 14:53:22
This may have a really obvious answer, but I am trying to put the
following into an XSL stylesheet in IE5b2:

	
		<xsl:apply-templates select="bar">
			<xsl:template match="@foo=3" />
		</xsl:apply-templates>

IE5b2 graciously spits back the following message:

	Expected token 'eof' found '='. @foo-->=<--3

This message from my tests seems to clearly be referring to the equals
sign. I have tryed escaping the 
equals sign in numerous ways, but to no avail. I have tried double
quotes and apostrophes for various scope
levels of the syntax. Nothing seems to get around the fact that the XML
compiler does not like an equals sign within the body of the value of an
attribute. 

Is there some way to get this to pass to XSL that I am missing, or is
this an incompatibility between XML and XSL patterns?

cheers,

erik


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

--- End Message ---
Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.