<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="Wj3C7c">> I find one particular issue: maybe the first text node should not be<br>
> removed unconditionally.<br>
</div></div></blockquote></div><br>Yes you're right I have just quickly suggested to correct it that way and thare are bugs in what I have sent you.<br><br>> Yes, do note that some of these will (probably) never work in IE<br>
> (replacing part of the table, options etc.).<br><br>What's is not supposed to work ? Those nodes work like in other browsers excepted it does not restrict contained nodes.<br><br>My last suggestion would be:<br>
var restrictedContainerNodes = {<br> 'TD': 'TABLE',<br> 'TH': 'TABLE',<br> 'TR': 'TABLE',<br> 'THEAD': 'TABLE',<br> 'TBODY': 'TABLE',<br>
'TFOOT': 'TABLE',<br> 'LI': 'UL',<br> 'DT': 'DL',<br> 'DD': 'DL',<br> 'OPTION': 'SELECT',<br> 'OPTGROUP': 'SELECT',<br>
};<br>kukit.dom.parseHTMLNodes = function(txt){<br> var firstNode = /<([^> ]*)[> ]/.exec(txt);<br> firstNode = firstNode ? firstNode[1].toUpperCase() : null;<br> var node = document.createElement(restrictedContainerNodes[firstNode] || 'DIV');<br>
node.innerHTML = txt;<br> // gecko engine automatically adds a TBODY node for table elements<br> if (node.firstChild) {<br> var elementNode = node.firstChild.nodeType != 3 ? node.childNodes[0] : <br> node.childNodes[1];<br>
if (restrictedContainerNodes[firstNode] == 'TABLE' &&<br> restrictedContainerNodes[elementNode.nodeName] == 'TABLE')<br> node = elementNode;<br> }<br> var resultNodes = [];<br>
for (var i=0; i<node.childNodes.length; i++) {<br> resultNodes.push(node.childNodes.item(i));<br> }<br> return resultNodes;<br>};<br><br><br clear="all"><br>-- <br>Christophe BOSSE - Développeur<br>INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632<br>
Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage<br>92210 Saint Cloud - France<br>Phone : 01 78 15 24 02 / Fax : 01 46 02 44 04<br><a href="http://www.ingeniweb.com">http://www.ingeniweb.com</a> - une société du groupe Alter Way