Re: no document.location for transformToFragment

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:
> Axel Hecht wrote:
>> Michael Vincent van Rantwijk wrote:
>>>
>>> I just ran into this problem. I can't use something like 
>>> 'document.location' after I've add an XSL Transformed fragment to a 
>>> target document. How do I solve this problem?
>>>
>>> Note that View Source and History are related problems, but I can add 
>>> the URL to the history with a few lines of code, but maybe I am 
>>> missing something completely, and there is a better way to solve all 
>>> these problems, no?
>>>
>>
>> Whether that's a bug, a feature or just you trying it the wrong way 
>> around is beyond my visionary capacities :-/.
> 
> Ok, so let me add that I use:
> 
> var request = new XMLHttpRequest();
> ../..
> request.responseXML
> 
> and not simply load the document. I have to, because we don't want the 
> XML document stylesheet that might have been included in the XML source 
> documents.
> 
>> We'd probably have to see your stuff in action to find out if it's a 
>> bug or a feature.
> 
> Just load any XML file and use .responseXML with some stylesheet to 
> transform it to either a document or documentFragment, instead of 
> loading the document and do the transformation after it has been loaded.

Sounds like you'd want to do something like this:

https://bugzilla.mozilla.org/show_bug.cgi?id=303400

I don't think that you have a good choice to do this right now.

Maybe you could get away with a content policy and some awfull hook like 
the feedview extension is using now. Observing all loads, and then take 
the pretty-printed result and transform it again. Yac.

Anyway, there's no way to get a new document into the viewer without 
hooking into the content load right now.

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.