xsl-list
[Top] [All Lists]

RE: [xsl] required parameter

2011-10-18 10:46:17
It returns

<form id="fLanguage" action="/en-GB/Language/Set" method="post"></form>

Thanks

-----Original Message-----
From: Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com]
Sent: 18 October 2011 16:39
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] required parameter

2011/10/18 Merrilees, David 
<David(_dot_)Merrilees(_at_)uk(_dot_)tesco(_dot_)com>:
Hi

I have an XSLT problem I don't understand. I pass a value in a parameter to a 
template like so:

<xsl:template match="/" as="element()">
      <div id="languageOption">
             <xsl:sequence select="model:model/model:LanguageOptions"
/>
             <xsl:apply-templates select="f:action-form('fLanguage',
'Set', 'Language', 'post')" mode="helper">
                    <xsl:with-param name="language-options"
select="model:model/model:LanguageOptions" />
             </xsl:apply-templates>
      </div>
</xsl:template>

Which is matched by this template:

<xsl:template mode="helper" match="form[@id = 'fLanguage']">
      <xsl:param name="language-options" required="yes"/>
</xsl:template>

and I get the error: 'No value supplied for required parameter 
$language-options'. Problem is, if I remove the required attribute, the line 
'<xsl:sequence select="model:model/model:LanguageOptions" />' works fine.

Input XML looks like this:

      <model:LanguageOptions>
             <model:SelectListItem>
                    <model:Selected>false</model:Selected>
                    <model:Text>Česky</model:Text>
                    <model:Value>cs-CZ</model:Value>
             </model:SelectListItem>
             <model:SelectListItem>
                    <model:Selected>true</model:Selected>
                    <model:Text>English</model:Text>
                    <model:Value>en-GB</model:Value>
             </model:SelectListItem>
      </model:LanguageOptions>

Any bright ideas?

What does f:action-form('fLanguage', 'Set', 'Language', 'post') return?

--
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


This is a confidential email. Tesco may monitor and record all emails. The 
views expressed in this email are those of the sender and not Tesco.

Tesco Stores Limited
Company Number: 519500
Registered in England
Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL
VAT Registration Number: GB 220 4302 31

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>