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

RE: Assigning variable values

Subject: RE: Assigning variable values
From: "Vladimir Stanciu" <vlads@xxxxxx>
Date: Mon, 27 May 2002 09:33:20 +0300
xml assigning variables
Variables REALLY cannont have values changed!

But it may be possible using some (I don't know what) parsers.
I saw this discussion and tested it myself. Look at my example:

(Using MSXML4 parser from Microsoft):

var.xml
-------

<?xml version="1.0" encoding="UTF-8"?>
<root>
 <load>Father</load>
</root>

var.xslt
--------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:variable name="var" select="/"/>
	<xsl:variable name="var" select="root/load"/>
</xsl:transform>

The output was:
---------------

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.


----------------------------------------------------------------------------
----

Global variable or parameter 'var' cannot be defined more than once with the
same import precedence.

=======================================

To conclude:
------------

If a var changing value IS supported by a parser or more,
it doesn't mean that it is supported by all of them. I consider
you should make use of the <xsl:param> instead in order to
stay compatible and W3C compliant. It's very important that we
all use the same compliance and, besides, you may run your
transformation on EVERY parsers! Have you ever thought what may
happen if you have to change the parser? Redesign your transformation?


Vladimir Stanciu
----------------

vlads@xxxxxx



 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.