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

Re: storing a variable value using <script> tags in be

Subject: Re: storing a variable value using <script> tags in between
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 8 Jan 2001 08:55:15 GMT
storing variables in xsl
> <xsl:variable name="qNum">
> <SCRIPT>
> parent.qNo;
> </SCRIPT>
> </xsl:variable>

> so as to get the value of the variable qNo equal to qNum? 

There is nothing special about a result element called SCRIPT to an XSL
engine, so that will make the variable qNum  into the result tree
fragment 

<SCRIPT>
parent.qNo;
</SCRIPT>
</xsl:variable>


In XSLT 1.0 that is just about identical in behaviour to the string
[newline]parent.qNo;[newline]

> I get this:
> parent.qNo;
> 
> while it should be a number....

No, it should be that string.

> and when I try this:
> <xsl:template
> match="Categorydefs/CategoryDef/QuestionDefs/QuestionDef[position()=$qNu
> I get that "Variables may not be used within this expression.

That error message seems quite explicit. If you check the XSLT
specification you will see that you are not allowed to use variables in
match expressions.

> Can anyone please help me here?
You've posted several messages containing invalid XSLT examples, but you
haven't said anywhere what you are trying to do, so it's rather hard to
give any help other than to confirm that your examples are wrong.

> Can anyone please tell me whether I can access certain nodes in the XML when
> I'm programming javascript in it?  

If you are producing HTML then you can include javascript in the output
but the XSLT engine will not see or execute it, the javascript will run
in whatever client is displaying the HTML. In particular the javascript
won't have access to the original XML, only to the generate HTML page in
which it is running.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 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.