Re: How to get XSLTProcessor.transformToDocument output in a tab/document?

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,
> 
> How do I display a XSL Transformed XMLDocument(fragment) after
> reading it in with XMLHttpRequest.open("GET", aURL) ???
> 
> Something like this works when I first load the XML uri into a tab:
> 
> var ownerDocument = document.implementation.createDocument("", "", null);
> var newFragment = processor.transformToFragment(doc, ownerDocument);
> var _documentElement = doc.documentElement;
> 
> while (_documentElement.hasChildNodes())
>   _documentElement.removeChild(_documentElement.firstChild);
> _documentElement.appendChild(newFragment);
> 
> But I don't want to load it into a tab.
> I just want to load it, transform it and put the output into a tab.
> I use this:
> 
> var newDocument = 
> processor.transformToDocument(XMLHttpRequest.responseXML);
> 
> instead of method transformToFragment (I hope that's the right thing use)
> without any warnings and errors, so it seems to be fine but...there's no
> output. Or when I change it a little, the complete window is overwritten
> replaced with the backgkround of my XSL stylesheet and a text for empty
> sidebar is displayed, so I must be doing something very wrong.
> 
> Again, everything works when I call my function *after* entering the URL 
> into
> the locationbar, but that's not what I want!
> 
> Uhg, I hope I made myself clear.
> I whish my English was a little better--maybe next year ;)
> 
> p.s I've accidentally asked the same question in another newsgroup, 
> sorry for that mistake!
> 

Sorry, we need a testcase here.

I do expect that you should call transformToFragment with the right 
owner document (probably just document, which is the one you're seeing 
and want to modify).

Axel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.