This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: passing arguments in the xml-stylesheet line
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 6 Dec 2001 17:52:19 -0700 (MST)
- Subject: Re: [xsl] passing arguments in the xml-stylesheet line
- Reply-to: xsl-list at lists dot mulberrytech dot com
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