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

Passing a list of arguments

Subject: Passing a list of arguments
From: "Mathieu Malaterre" <mathieu.malaterre@xxxxxxxxx>
Date: Fri, 9 Nov 2007 12:19:03 +0100
 Passing a list of arguments
Hello,

  I have a list of arguments to pass to my XSLT. I thought that I
could simply construct a small XML tree to do that. I do not
understand why the list argument tree is being expanded. How was I
supposed to do that ?

Thanks
-Mathieu

test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<article>
</article>

test.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
  <xsl:variable name="sections-list">
    <section>
      <section>C.8.7.1.1.2</section>
      <section>C.8.14.1.1</section>
      <!-- ... -->
    </section>
  </xsl:variable>
  <xsl:template match="article">
    <xsl:param name="extract-section"/>
    <xsl:message>
      <xsl:value-of select="$extract-section"/>
    </xsl:message>
  </xsl:template>
  <xsl:template match="/">
    <xsl:for-each select="$sections-list">
      <xsl:apply-templates select="article">
        <xsl:with-param name="extract-section" select="$section"/>
      </xsl:apply-templates>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>


-- 
Mathieu

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.