[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: multiple tranformations in XMLDOM

Subject: RE: multiple tranformations in XMLDOM
From: "Américo Albuquerque" <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Thu, 18 Jul 2002 15:17:30 +0100
activexobject microsoft.xmldom
sorry, didn't use the loadXML, but use transformNodeToObject
to use the loadXML replace the
'xmlDoc.transformNodeToObject(xslDoc,newxmlDoc);'
with 'newxmlDoc.loadXML(xmlDoc.transformNode(xslDoc);'

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Américo
Albuquerque
Sent: Thursday, July 18, 2002 2:56 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  multiple tranformations in XMLDOM


Hi Bryan
the msxml (the one you are using) has two load methods, load(file) and
loadXML(text)
what you want to do is something like this:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load("source.xml");

var xslDoc = new ActiveXObject("Microsoft.XMLDOM");
xslDoc.load("trans1.xsl");

var newxmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.transformNodeToObject(xslDoc,newxmlDoc);
// note: the result from trans1.xsl must be a well-formed xml or this
pass will fail

var htmlout = new ActiveXObject("Microsoft.XMLDOM");
htmlout.load("trans2.xsl");

var htmloutput = newxml.transformNode(htmlout);

document.write(htmloutput);

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Bryan
Tarantina
Sent: Wednesday, July 17, 2002 7:27 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  multiple tranformations in XMLDOM


Hey guys,

I have a small problem I am working on. Here's the
process:

source.xml + trans1.xsl -> out.xml

then:

out.xml + trans2.xsl -> out.html

This is all done with the XMLDOM in Javascript. I need
to go straight to the out.html file, so no saving
files in the interim steps. The trick: the out.xml
file actually contains html source I am treating as
XML (since it is well-formed).

Both XSL sheets have output specified as XML.

In Javascript I can create the variables and get each transformation
done separately (if I save out.xml as a file), but I am having problems
getting the second one to work off the direct output of the first.
Here's what I have in Javascript:

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM") xmlDoc.async="false"
xmlDoc.validateOnParse="false"
xmlDoc.load("source.xml")

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

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

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

var htmlout = new ActiveXObject("Microsoft.XMLDOM")
htmlout.async="false" htmlout.validateOnParse="false"

htmlout =  xmlDoc.transformNode(xslDoc)

var htmloutput = new ActiveXObject("Microsoft.XMLDOM")
htmloutput.async="false" htmloutput.validateOnParse="false"

htmloutput = htmlout.transformNode(newxslDoc)

document.write(htmloutput)


anyideas?

Bryan


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes http://autos.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



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.