RE: [xsl] Filtering XML with XSL

Subject: RE: [xsl] Filtering XML with XSL
From: "Sam Awad" <sammy_awad@xxxxxxxxx>
Date: Sun, 9 Feb 2003 11:15:09 -0700
Chuck,

No, That's not what I meant. I test the xsl sheet using a stand alone xml
file as well. But the filter javascript only works when I remove the entries
to load the xsl file from the document object and load it from a file
located on the file system instead like this (same thing for the xml file):

function filter(userFirstName){

		var s = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
                s.async="False";
//		var x = document.XMLDocument;
		var x = "./EmployeeAD.xml";

//		if (x == null){
//			x = navigator.XMLDocument;
//			s.loadXML(navigator.XSLDocument.xml);
//		}else{
//			s.loadXML(document.XSLDocument.xml);
			s.load("./Main-EmployeeAD.xsl");
		}
		var tem = new ActiveXObject("MSXML2.XSLTemplate");
		tem.stylesheet = s;
		var proc = tem.createProcessor();
		proc.addParameter("userFirstName", userFirstName);
		proc.input = x;
		proc.transform();
		var str = proc.output;

		var newDoc = document.open("text/html");
		newDoc.write(str);
		navigator.XMLDocument = x;
		navigator.XSLDocument = s;
}

Cheers,


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Charles White
Sent: Friday, February 07, 2003 9:53 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Filtering XML with XSL




> Chuck and Steve: Thanks for all your help. It definitely helped taken out
> the exception handlers to debug. I am using the same script that Chuck was
> using but unfortunately it does not work for me.
>
> Not sure why the jscript cannot use the properties from the document or
> navigator objects.
> I can only get it to work (see below) if I have static .xml and .xsl files
> (like your .asp script Steve); but that is not accomplishing client-side
> filtering at all and it adds more maintenance work. Such is life.

Are you saying that the script works okay if you are using a standalone,
static XML file with a PI pointing to the stylesheet? This is how I tested
it, and it worked okay. The fact you're running through Active Directory may
be the reason for your problems, but it sounds like your the document is
loading okay at first.

>
> Next, I'll try to run it on a machine with msxml ver 4  and see if that
> helps. If anyone has any ideas I'll try them.

Well, if you do that, be sure you call the correct objects for MSXML 4:
Msxml2.FreeThreadedDOMDocument.4.0
and
Msxml2.XSLTemplate.4.0

Cheers,

Chuck White
Author, Mastering XSLT, Sybex Books
http://www.javertising.com/webtech
http://www.tumeric.net


 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