This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: passing username


Hi Gloria,

> I am using (test.xsl + test.xml) to produce another form on the
> browser. Is there any way of getting value of the username passed to
> the second form (i.e. form that generated from (test.xml + test.xsl)

You need to pass the username in as a parameter to test.xsl.  Set up
test.xsl so that it can accept the parameter, using an xsl:param
element at the top level of the stylesheet (i.e. as a child of
xsl:stylesheet):

<xsl:param name="username" />

Then use this $username when you create the form with test.xsl.  For
example, to get its value you can use:

  <xsl:value-of select="$username" />

How you pass in the parameter to the stylesheet depends on what XSLT
processor you're using.  If you're using MSXML (i.e. doing the
transformation client-side with IE) then you need to script the
transformation and use the addParameter() method:

  addParameter('username', form.username)

That entails adding some Javascript to the login.html page. See the
MSXML SDK documentation for more details.

If you're using Cocoon then you can use the URL to pass the parameter,
so for example:

  test.xml?username=Fred

will set the username parameter to the string 'Fred'.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]