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

Re: Document function (was Getting an error with a va

Subject: Re: Document function (was Getting an error with a variable)
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 29 Jul 2006 10:02:57 +0100
g.e. adams
>>>>> "Garry" == Garry Searle <garry@xxxxxxxxxxxxxxxxxx> writes:

    Garry> Thanks Colin I looked into the document function and got it
    Garry> working. The xml file will always be the same, so no need
    Garry> to pass the url in a parameter. This is a snippet of
    Garry> code. Am I on the right track or is there a more efficient
    Garry> way?

    Garry>   <xsl:for-each
    Garry> select="/legs/competition/leg/Competitor[../../@name=$paramVal1]">
    Garry> <tr> <td><xsl:value-of select="@no"/></td> <xsl:variable
    Garry> name="cNum"> <xsl:value-of select="@no"/> </xsl:variable>
    Garry> <td><xsl:value-of
    Garry> select="document('EntryList.xml')/entrylist/competition/entry/@driverSurname
    Garry> [../@no=$cNum]"/> <td><xsl:value-of
    Garry> select="document('EntryList.xml')/entrylist/competition/entry/@coDriverSurna
    Garry> me[../@no=$cNum]"/> <td><xsl:value-of
    Garry> select="@stageTime"/>&#160;</td> <td><xsl:value-of
    Garry> select="@penaltyTime"/>&#160;</td> <td><xsl:value-of
    Garry> select="@totalTime"/>&#160;</td>

I don't know about whether or not it would be more efficient, but I
would set a variable for the common path expression document('EntryList.xml')/entrylist/competition/entry.
-- 
Colin Adams
Preston Lancashire

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.