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

Re: xslt, document() Q?

Subject: Re: xslt, document() Q?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 18 Oct 2001 12:20:57 -0400
xslt document concat
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




====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.