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

Document function (was Getting an error with a variabl

Subject: Document function (was Getting an error with a variable)
From: "Garry Searle" <garry@xxxxxxxxxxxxxxxxxx>
Date: Sat, 29 Jul 2006 18:18:07 +0930
xml document function
Thanks Colin

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

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

Thanks
Garry

-----Original Message-----
From: Colin Paul Adams [mailto:colin@xxxxxxxxxxxxxxxxxx]
Sent: Saturday, 29 July 2006 4:13 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Getting an error with a variable


>>>>> "Garry" == Garry Searle <garry@xxxxxxxxxxxxxxxxxx> writes:

    Garry> I'm wanting to combine 2 xml files. One has a list of car
    Garry> number and competitor names, the other is a list of
    Garry> times. Essentially a relational database. I use .asp to
    Garry> pass the xml and xsl files. Is it possible to pass 2 xml
    Garry> files, or how can I access the data from the 2nd xml
    Garry> file. Could you point me to some documentation. I havent
    Garry> been able to find anything.

You could pass the URI of the second file as a stylesheet parameter.
Then use the document() function.
--
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.