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

dynamic file variable

Subject: dynamic file variable
From: yan bai <bytj@xxxxxxxxx>
Date: Mon, 5 Nov 2001 12:51:16 -0800 (PST)
xml file variable
I have a main.xml file, in which there is a lot of
<ref> elements.
There is an attribute "linkname" in each <ref> like:
<ref linkname="test_2.xml"/>

In test_2.xml, there is only one root element and a
child element like:
<test>
      <sub_test link="html_test.html"/>
</test>

I use the following code to get the referenced data:
<xsl:template match="ref">
<xsl:variable name="refname">
       <xsl:value-of select="@refname"/>
</xsl:variable>
<br/>
Here is the referenced file data:
<xsl:value-of 
select="document($refname)/test/sub_test/@link"
/>
</xsl:template>

It returns null.  However, if the variable "$refname"
is replaced by the actual file name "test_2.xml", then
the data can be properly grabbed.

Any one can tell me what is wrong?

Thanks so much




__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

 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.