RC wrote:
Quote:
// Now I got an XML object here
var xmlDocument = XMLHttpRequestObject.responseXML;
Quote:
The problem is DOM requires you are an excellent JavaScript programmer
to deal with firstChild, lastChild, nextSibling, etc.
Your pure (or core) JavaScript skills don't matter much to manipulate
the DOM, you need to know the document object model and the differences
in the browser implementations.
Quote:
And 2nd problem is different browsers will have different results.
Sometime work in Firefox/Netscape, but not work in IE, etc.
>
In my XML file has a line
<?xml-stylesheet type="text/xsl" href="myXSLTFile.xsl" ?>
>
I would like use a very simple XSLT file do the work, no DOM programming
deal with those "children".
>
>
So back to my question, How to use AJAX to deal with XSLT instead deal
with DOM?
I don't think you gain much by moving to XSLT as you still need script
to run the transformation and as the differences in XSLT processor APIs
are worse than the DOM differences. And finally you need to insert the
result of the XSLT transformation into the HTML DOM document.
Mozilla's XSLT processor API is documented here:
<http://developer.mozilla.org/en/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Tran sformations>
Opera 9 supports the same API.
IE 6 and later use MSXML 3 to support XSLT 1.0, there are different APIs
you can use with MSXML (e.g. transformNode, transformNodeToObject, and
an XSLT processor API to set parameters).
Opera 8 does not support client side XSLT 1.0. Nor do IE 5 and 5.5
unless MSXML 3 is installed in addition to IE.
Safari/Konqueror I think support client-side XSLT but have no API
exposed to JavaScript.
--
Martin Honnen
http://JavaScript.FAQTs.com/