Re: problem with empty tag
"mozilla" <[email protected]> Tue, 18 Sep 2007 17:38:17 +0200
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Message-ID | <[email protected]> |
It's working thank you a lot :) K.L.Nikita "Martin Honnen" <[email protected]> a écrit dans le message de news: [email protected]... > mozilla wrote: > >> thanks for the quick reply, here is the URL : >> http://dev.afidium.com/testXSLT/ > > The problem (with Mozilla) is the following use of XMLSerializer: > > var html = XSLProcessor.transformToFragment( > XMLDoc, document ); > html = ( new > XMLSerializer() ).serializeToString( html ); > OutputDiv.innerHTML = html ; > > Simple replace that with > > while (OutputDiv.hasChildNodes()) > { > OutputDiv.RemoveChild(OutputDiv.lastChild); > } > > OutputDiv.appendChild(XSLProcessor.transformToFragment(XMLDoc,document)); > > that way it should work and is much more efficient as transformToFragment > already gives you HTML DOM nodes that can simply be inserted. > > Your current code creates HTML DOM nodes, then serializes them according > to XML rules with XMLSerializer to then parse the result according to HTML > rules again. All unncessary and prone to errors as XML serialization and > HTML parsing do not follow the same rules. > > > > -- > > Martin Honnen > http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-xslt mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xslt