Subject: Re: [xsl] passing arguments in the xml-stylesheet line From: "Garrick Besterwitch" <garrickb@xxxxxxxxxxx> Date: Fri, 7 Dec 2001 11:56:42 +0530 |
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: [xsl] 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] passing arguments in the , Mike Brown | Thread | Re: [xsl] passing arguments in the , David Carlisle |
[xsl] ANN: New editions of two book, G. Ken Holman | Date | Re: [xsl] Welcome comments: White s, Daniel Veillard |
Month |