Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2007, 11:47 AM
Authorized User
Points: 145, Level: 2
Points: 145, Level: 2 Points: 145, Level: 2 Points: 145, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft.XMLDOM Alternative?

Hi All!

I am using this simple html example page (see code below) to "join" the XML and XSL file together and show in the Browser to avoid any possible timing issues I had before, etc. All works fine in the Internet Explorer but no other browser seems to be knowing what to do (Safari, etc.)

Is there any OTHER intelligent way of doing the same transformation but in a way that it is understood by the majority of browsers?

THANKS!!!
GAbi.

Code:
<html>
<body> 
<script language="javascript" for="window" event="onload"> 

// Load XML 

var xml = new ActiveXObject("Microsoft.XMLDOM") 
xml.async = false 
xml.load("appdemo.xml")

// Load the XSL 

var xsl = new ActiveXObject("Microsoft.XMLDOM") 
xsl.async = false 
xsl.load("appdemo.xsl")

// Do the transformation

document.write(xml.transformNode(xsl)) 

</script> 

</body> 

</html>
 
Old September 10th, 2007, 12:29 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Lake a look at Sarissa.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 10th, 2007, 01:00 PM
Authorized User
Points: 145, Level: 2
Points: 145, Level: 2 Points: 145, Level: 2 Points: 145, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Michael!

I took a quick look at it and it seems to be a thing residing on the client's machine that sort of "makes peace" for each browser - if I understand that right.

I am not sure at this point what is more efficcient - to program my pages to work in all possible browser or to ask the client to install Sarissa...

What would make sense to you?

Thanks again,
GAbi.

 
Old September 10th, 2007, 01:04 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I prefer not to give advice on technology choices when I have so little information about the requirements. If you want consultancy, I can quote you a rate.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 11th, 2007, 02:30 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You don't install Sarissa, it's a JavaScript wrapper around the different XML processor variations that gives you the appropriate version depending on which browser you are using. This means that you can use the Sarissa classes and code identically knowing, in theory, that it will work in all browsers. Another similar wrapper is Nicholas C. Zakas' zXml.

--

Joe (Microsoft MVP - XML)




Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript and XMLDOM kirthi97 XML 4 June 27th, 2006 02:22 AM
Pogramming the XmlDOM in C# sencee C# 5 March 10th, 2006 11:09 AM
access sub nodes using XMLDOM lian_a Classic ASP XML 2 January 19th, 2005 09:43 PM
XMLDOM problem braindog_43 Javascript How-To 2 January 16th, 2005 01:54 PM
XMLDOM problem braindog_43 XML 2 January 16th, 2005 01:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.