It is possible to convert an XML document to XHTML using the browser’s own parser. However, this is not always possible:
- The browser at the client end may not be suitable or equipped to do the transformation.
- It may not be a good idea to include the reference to the style sheet or even have the stylesheet available.
- The answer to this process the document and stylesheet outside of the browser’s own mechanism for doing this task.
- This task can be done either on the client side or the server side.
var xml= new ActiveXObject(“Microsoft.XMLDOM”) xml.async=false xml.load(“lib.xml”) //Load the XSL document
var xsl= new ActiveXObject(“Microsoft.XMLDOM”) xsl.async= false xsl.load(“libstyle.xsl”)
//Do the actual transform
It is also possible to process XML using the DOM.