using innerHTML to display xsl-transformed XML?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
tempomental
Forum Newbie
Posts: 5
Joined: Wed Jun 24, 2009 10:12 pm

using innerHTML to display xsl-transformed XML?

Post 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
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: using innerHTML to display xsl-transformed XML?

Post 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
Post Reply