Page 1 of 1

using innerHTML to display xsl-transformed XML?

Posted: Mon Jun 29, 2009 4:27 pm
by tempomental
Hello,

I'm wondering if there is a limitation to the innerHTML function that will not let me plug XSL-transformed XML into it.

I'm retrieving XML data from a Web site, using PHP to insert a stylesheet reference, and then returning the whole of it to the original Javascript call (xmlhttp.open()). I'd like to display the formatted XSL within a div/ container... is this possible? Is there an alternative?

Thanks

Re: using innerHTML to display xsl-transformed XML?

Posted: Sun Jul 05, 2009 1:04 pm
by JAB Creations
The method innerHTML is not DOM compliant, no matter how much other people will tell you. Yes the DOM can sometimes see imported (X)HTML, XML, etc however it's not truly part of the DOM.

What you want to do is get used to working with nodes (childNodes, lastChild, firstChild, getElementsByTagName, importNode, etc).

Start by reading about nodes here...
http://www.howtocreate.co.uk/tutorials/ ... /dombasics