|
Subject: Re: [xsl] Document function (was Getting an error with a variable) From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> Date: 29 Jul 2006 10:02:57 +0100 |
>>>>> "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"/> </td> <td><xsl:value-of
Garry> select="@penaltyTime"/> </td> <td><xsl:value-of
Garry> select="@totalTime"/> </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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Document function (was Gettin, Garry Searle | Thread | RE: [xsl] Document function (was Ge, Michael Kay |
| RE: [xsl] Glossary Help, Shailesh Shinde | Date | RE: [xsl] Document function (was Ge, Michael Kay |
| Month |