RE: [xsl] Re: XSL-List Digest V3 #731

Subject: RE: [xsl] Re: XSL-List Digest V3 #731
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Sat, 5 May 2001 08:48:55 +0100
Carlton,
Your transform knows nothing about the Request object *nor* does IE the
Request object is a serverside thing.
Again *look* at
http://www.bayes.co.uk/xml/index.xml?/xml/tutorial/paging/paging.xml and you
will see you do not need to do this.
But if you need to do this as the result of a post for some bizarre reason
then create and add a request object to the processor.

var qs = document.location.search;
var Reqest = new Array();
var ps = qs.replace(/&amp;/, "&");
var psa = ps.split("&");
for (var i=0; i < psa.length; i++){
	var p = psa[i].split("=");
	// add logic here for duplicate fields
	Request[p[0]] = p[1];
}

proc.addObject(Request, "urn:carltonNoles-RequestObject");

Then in your stylesheet add the urn
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:Request="urn:carltonNoles-RequestObject"
>
Then you can use it as in
<xsl:when match="LName=Request:QueryString('name')">
Note the ":"

This would have to be a very bizarre reason because I don't see how you can
execute your script if you are posting to some xml with <form
action="some.xml" that contains a stylesheet pi.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Carlton Noles
>Sent: 05 May 2001 00:26
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: [xsl] Re: XSL-List Digest V3 #731
>
>
>I solved the other problem with some javascript as
>follows...
>
><script language="javascript">
>// Load XML
>var xml = new ActiveXObject("Microsoft.XMLDOM")
>xml.async = false
>xml.load("Contactlist.xml")
>
>// Load the XSL
>var xsl = new ActiveXObject("Microsoft.XMLDOM")
>xsl.async = false
>xsl.load("addhead.xsl")
>
>// Transform
>document.write(xml.transformNode(xsl))
></script>
>
>now i am having another problem...
>processing via the above script i want to pass a value
>to the xsl to use in an xsl:choose statement.
>when i try this ...
>
><xsl:choose>
>        <xsl:when
>match=".[LName=request.querystring(name)]">
>
>I get an unknown method error. Is there a way to pass
>a value through and us it in such a manner?
>
>regards
>carlton noles
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Auctions - buy the things you want at great prices
>http://auctions.yahoo.com/
>
> 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