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

match attribute values

Subject: match attribute values
From: "Mac Martine" <email@xxxxxxxxxxxxxxxx>
Date: Thu, 27 Mar 2003 13:08:03 -0800
xsl match attribute value
Hello-
 I am trying to find all values of a specified attribute and sort them
in order. I know this is normally really easy, but I add one complicated
factor. Sometimes the attribute will have multiple values separated by a
','. I am assigning certain elements a task number, but some elements
will have multiple task numbers. So I need to go through and find which
elements holds the certain value that I am looking for. I am only
supplying the stripped code for the issue I am having (I have not
included the string splitting code, etc). With the code below I get a
recursion error. So, I basically need to find the element where @task =
1, then where @task = 2, @task = 3 and so on. So, any help would be
appreciated, or any more clever approaches than what I am attempting
here. Thanks-
 Mac



<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
        <body>
        <table width="80%">
                <xsl:apply-templates select="//*[@task = 1]">
                        <xsl:with-param name="nextTask" select="1"/>
                </xsl:apply-templates>
        </table>
        </body>
</xsl:template>

<xsl:template match="*">
        <xsl:param name="nextTask"/>

        <br />
        -->> @TASK = <xsl:value-of select="@task" /> : $NEXTTASK =
<xsl:value-of select="$nextTask" />

        <xsl:if test="@task = $nextTask">
                (<xsl:value-of select="local-name()" />)
        </xsl:if>

        <xsl:apply-templates select="//*[@task=2]">
                <xsl:with-param name="nextTask" select="2"/>
        </xsl:apply-templates>
</xsl:template>

</xsl:stylesheet>



 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.