[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xslt, document() Q?
Jakub,
Yes, this can be done. At 06:05 PM 10/17/01, you wrote: <xsl:template match="addr"> <xsl:call-template name="translate_v3-v2"> <xsl:with-param name="tableno">123"</xsl:with-param> <!?how to set the value of this parameter to the value of the attribute "use"? Is it possible like this? --> <xsl:with-param name="v3code" select="@use"/> Yes, that should do it. Is this not working? If it's not, it might be the line (higher up) <xsl:value-of select="document(concat($dir, 'table', $tableno, '.xml'))/table/item[input=$v3code]/output/text()"/> which is somewhat brittle. The XPath itself looks good (although the final /text() step is unnecessary), but you need to be careful with the concat($dir, 'table', $tableno, '.xml') to make sure it resolves to a file name that will actually be found. It might need to be concat($dir, '/table', $tableno, '.xml') and $dir might need to be '/tables' not 'tables', etc. I would test it with a literal string before parameterizing this setting, to make sure the other parts of your stylesheet are working correctly. Then build the concat step by step -- to debug, you could ask for its value in your output, just to look at it. There are ways to improve the efficiency of these operations, but it looks to me like you've basically figured out how it should work. Good luck, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|