XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
fsda fdasSubject: Using javascript to transform xml
Author: fsda fdas
Date: 01 Jun 2006 01:42 PM
I'm currently using the following javascript to transform xml. However, it does not work in Firefox. Does anyone know why or if there is code available that could accomplish this in both IE and Firefox?

Thanks.

<html>
<body>

<script type="text/javascript">

// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("all.xml")

// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("all.xsl")

// Transform
document.write(xml.transformNode(xsl))

</script>

</body>
</html>

Posttop
Ivan PedruzziSubject: Using javascript to transform xml
Author: Ivan Pedruzzi
Date: 01 Jun 2006 02:13 PM

If you really need to run tranformation on the client you could use the xml-stylesheet processing instruction
http://www.w3.org/TR/xml-stylesheet

A better solution if applicable to your case would be to use a server page technology (ASP or JSP) so the script runs on the server

XSLT, Server Side, ASP
http://www.w3schools.com/xsl/xsl_server.asp

XSLT, Servlet, JSP
http://xml.apache.org/xalan-j/usagepatterns.html#servlet

please see the related documentations for more details

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.