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

Re: passing arguments in the xml-stylesheet line

Subject: Re: passing arguments in the xml-stylesheet line
From: "Garrick Besterwitch" <garrickb@xxxxxxxxxxx>
Date: Fri, 7 Dec 2001 11:56:42 +0530
passing arguments to xsl
Hi ,

  I have a globle variable defined at the top of my xsl file....
How do I change the value of this variable  based on some condition inside a
template????.

Thanks
Garrick

----- Original Message -----
From: "Mike Brown" <mike@xxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, December 07, 2001 6:22 AM
Subject: Re:  passing arguments in the xml-stylesheet line


> Todd Binder wrote:
> > <?xml-stylesheet type="text/xsl" href="training_city.xsl"?>
> >
> > is it possible to pass an argument to the given XSL file that would be
> > interpreted within the XSL file with the <xsl:para name="city"/>
>
> That's a processing instruction, and it technically has only 2 parts:
> the target ("xml-stylesheet") and the instruction (the string that comes
> after the target, starting with "type=...")
>
> There is a W3C Recommendation that dictates the semantics of the
> xml-stylesheet processing instruction. It says that this p.i. is used
> to associate an XML document with a stylesheet, and that the instruction
> is formatted to look like attributes (pseudo-attributes, they call 'em),
> which can be used by the application receiving the instruction string
> from the XML parser. One of the attributes is the "type" which should
> be an IANA-registered Internet media type (which excludes text/xsl,
> despite Microsoft's insistence on using it here) for the stylesheet,
> and another attribute is the "href" pointing to the stylesheet.
>
> No other pseudo-attributes or semantics are mandated by the W3C for
> the xml-stylesheet p.i., so it falls on the application (Internet
> Explorer w/MSXML, in your case), to provide its own mechanisms for
> additional functionality.
>
> > so the line in my XML file would look like the following...
> > <?xml-stylesheet type="text/xsl" href="training_city.xsl?city=5921"?>
>
> There is nothing stopping IE from recognizing such a thing, or using
> some other pseudo-attribute or another processing instruction to
> pass the parameter, but to my knowledge, it does not do so.
>
> > i am aware that i could use ASP along with the Msxml2.DOMDocument to
> > addParameters to an XSL file, but i wanted to see if i could do it from
> > command-like syntax, and avoid having to use ASP.
>
> I think you're out of luck. The xml-stylesheet p.i. is for a simple
> association of an XML document with a stylesheet.
>
>    - Mike
>
____________________________________________________________________________
>   mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
>   denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.