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

Feature Request: OtherNodeExpr: SelfExpr

Subject: Feature Request: OtherNodeExpr: SelfExpr
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Jan 1999 12:58:51 -0500
Feature Request: OtherNodeExpr: SelfExpr
I can't see from production [11] how I would write a test= value checking
for a particular node.

Consider:

   <xsl:for-each select="thing1|thing2">
     <xsl:choose>
       <xsl:when test="{what goes here to test for thing1?}">
         ...processing for a thing1 element...
       </xsl:when>
       <xsl:otherwise>
         ...processing for a thing2 element...
       </xsl:otherwise>
     </xsl:choose>
   </xsl:for-each>

Different patterns check for everything but just self:

   "thing1" - won't work because it relates to children
   "./thing1" - same as "thing1"
   "../thing1" - will be true for thing2 if thing1 is a sibling
   "ancestor-or-self(thing1)" - will be true for thing2 if there is a
thing1 ancestor

.... so, I think I need a pattern as follows:

   <xsl:for-each select="thing1|thing2">
     <xsl:choose>
       <xsl:when test="self(thing1)">
         ...processing for a thing1 element...
       </xsl:when>
       <xsl:otherwise>
         ...processing for a thing2 element...
       </xsl:otherwise>
     </xsl:choose>
   </xsl:for-each>

Am I missing something that is already there?

........ Ken

--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11


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


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.