Re: appendChild(newFragment) problem
Axel Hecht <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Michael Vincent van Rantwijk wrote:
> Hi,
>
> I finally managed to get my source code running, but I have a little
> problem which can be seen in the attached image (that shows the
> duplicated elements).
>
> I use something like this:
>
> var targetDocument = gBrowser.contentDocument
> var newFragment = processor.transformToFragment(xmldoc, targetDocument);
> var _documentElement = targetDocument.documentElement;
>
> // remove HEAD and BODY elements
> while (_documentElement.hasChildNodes()) {
> _documentElement.firstChild.localName);
> }
>
> _documentElement.appendChild(newFragment);
>
> and that works, except that I end up with two HTML elements, one in
> uppercase, and one in lowercase, so how do I prevent this?
>
You need to skip the html element in your output fragment as well.
Axel