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

RE: Problem with iterating through a sequence of integ

Subject: RE: Problem with iterating through a sequence of integers
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Mon, 28 Apr 2008 17:03:58 -0400
RE:  Problem with iterating through a sequence of integ
Hi Andrew,

> It seems an odd requirement (I've never needed to
> process a sequence in this way) - maybe you could
> define the requirements a little more fully?

I am creating a tutorial on XPath! (oddly enough)

To demonstrate how an XPath expression is evaluated, I have an XSLT
for-loop that iterates over each value in the sequence specified by the
XPath:

    <xsl:for-each select="XPath Expression">
       -- if the value is a node,
       -- then show the node; otherwise (it's
       -- an atomic value) show the atomic value.
    </xsl:for-each>

So, I tried to implement it like this:

    <xsl:for-each select="XPath Expression">
        <xsl:choose>
            <xsl:when test=". instance of node()">
                <xsl:apply-templates select="." />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="."/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>


/Roger

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.