Re: attribute value test.

Subject: Re: attribute value test.
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Jun 1999 09:26:53 -0400
Hello Dave!

At 99/06/03 12:36 +0100, DPawson@xxxxxxxxxxx wrote:
>I'm trying to test if a nodes parent contains an attribute named 'inserted'
>with value 'yes'
>     <xsl:when test="../@inserted ='yes' ">
>     <xsl:attribute name="style">color: red</xsl:attribute>
>      </xsl:when>
>     </xsl:choose>
>xt keeps telling me there is an unexpected token in the line
>beginning xsl:when.

Since it looked correct to me, I copied your text verbatim into a test
script and it appears to work just fine (see below). 

Perhaps one of your spaces isn't a space but a &nbsp;?  or perhaps a quote
is a word processing font quote and not an ASCII quote?

Perhaps you are not running with XT19990514 (I haven't tested the below
with any earlier version)?

Sorry I can't think of anything more.

............ Ken

T:\davep>type test.xml
<?xml version="1.0"?>
<tests inserted="yes">
  <test>A test</test>
<tests inserted="no">
  <test>Another test</test>
T:\davep>type test.xsl
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="";>

<xsl:template match="//test">                    <!--root rule-->
     <xsl:when test="../@inserted ='yes' ">
     <xsl:attribute name="style">color: red</xsl:attribute>



T:\davep>call xsl test.xml test.xsl testout.xml
T:\davep>type testout.xml

  <thing style="color: red"/>



G. Ken Holman                  mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. 
Box 266, Kars, Ontario CANADA K0A-2E0  +1(613)489-0999  (Fax:-0995)
Website: XSL/XML/DSSSL/SGML services outline,  XSL/DSSSL shareware,
         stylesheet resource library, conference training schedule,
         commercial stylesheet training materials, on-line XSL CBT.

 XSL-List info and archive:

Current Thread