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

xslt filtering question

Subject: xslt filtering question
From: <davekennedy@xxxxxxxxxxxx>
Date: Mon, 17 May 2004 11:30:39 -0400 (EDT)
xslt filtering
Hey, I'm having trouble writing an expression to match any occurance of
'w' in  a 'permission' attribute within a block of xml.  There can be
n-many 'fieldinfo' elements, and if any has a permissions attribute with a
'w' in it, I need to take one action, and another if there are no 'w's. 
In the code snippet below the xml block, the xpression im feeding
'contains' isnt properly written, I'm fairly new and having trouble with
it, any help would be appreciated.

<xml>
  <resultset>
    <resultinfo>
      <fieldinfo displayname="" name="userid" permissions=""/>
      <fieldinfo displayname="" name="username" permissions="rw"/>
      <fieldinfo displayname="" name="password" permissions="r"/>
      <fieldinfo displayname="" name="userlevel"permissions="rw"/>
    </resultinfo>
  ..
</xml>



<xsl:choose>
  <xsl:when
test="contains(/xml/resultset/resultinfo/fieldinfo/@permissions, 'w')">
    <a>
      <xsl:attribute name="href">http://url</xsl:attribute>
      Edit
    </a>
  </xsl:when>
  <xsl:otherwise> Edit </xsl:otherwise>
</xsl:choose>

---

David Kennedy
Program Manager, Alescere LLC.
630.968.8950 x311

Find us on the web at http://www.alescere.com

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.