halfondj
asked on
XSL question: What's the difference between a template processor vs. DOMDocument?
In my application, I'm currently using DOMDocument40 to load my XML and XSL files.
1. What is a template processor and when should it be used?
2. Using JavaScript, how is code written to use the template processor?
Thanks.
1. What is a template processor and when should it be used?
2. Using JavaScript, how is code written to use the template processor?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just to be clear, I gave you three examples of:
myProc.output = foo
You choose one of the three, as appropriate, and use it--not all three at the same time. If you were doing this server-side, you'd probably write to the response stream directly, and call myProc.transform() at the point in the page where you want the results to stream to the client.
I guess I should proof read *before* I click submit!
Regards,
Mike Sharp
myProc.output = foo
You choose one of the three, as appropriate, and use it--not all three at the same time. If you were doing this server-side, you'd probably write to the response stream directly, and call myProc.transform() at the point in the page where you want the results to stream to the client.
I guess I should proof read *before* I click submit!
Regards,
Mike Sharp
ASKER
My application is standalone and will consist of a server side. I'm then assuming that I should just use:
var xmlDoc = new ActiveXObject("Msxml2.DOMD ocument.4. 0");
xmlDoc.async = false;
xmlDoc.load("myXMLData.xml ");
var xslDoc = new ActiveXObject("Msxml2.DOMD ocument.4. 0");
xslDoc.async = false;
xslDoc.load("myStylesheet. xslt");
Also, I notice in all the examples that no one codes error handling. Isn't it good to check if the the XML and XSL loaded?
Thanks.
var xmlDoc = new ActiveXObject("Msxml2.DOMD
xmlDoc.async = false;
xmlDoc.load("myXMLData.xml
var xslDoc = new ActiveXObject("Msxml2.DOMD
xslDoc.async = false;
xslDoc.load("myStylesheet.
Also, I notice in all the examples that no one codes error handling. Isn't it good to check if the the XML and XSL loaded?
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again for the excellent description. You certainly desearve all the points you get :).
var xslDoc = new ActiveXObject("Msxml2.Free
should be:
var xslDoc = new ActiveXObject("Msxml2.Free