Re: Only text of XSLT transformed data appearing no stlying!

Axel Hecht <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Message-ID <[email protected]>
Wonker wrote:
> I have a page which downloads a xsl and xml file with ajax. I then use 
> xslt to transform them using the following code -
> 
> var xslt = new XSLTProcessor();
> xslt.importStylesheet(xsl);
> var fragment = xslt.transformToFragment(xml, document);
> document.getElementById("content").innerHTML = "";
> document.getElementById("content").appendChild(fragment);
> 
> But only the text appears in the resulting browser display. Is there 
> something that is obviously wrong?
> 
> If I do the xslt transform by command line (using xalan) it works fine 
> (the divs appear as they should).
> 
> Can anyone help. I have put the source code online (just unzip and it 
> should work, if you open the rubbermallet.html in a browser) -
> 
> http://www.rubbermallet.net/example.zip
> 
> Any help would be appreciated. I am new to this stuff so you will have 
> to excuse the poor code in the javascript.

Not looking at your example I'm pretty sure that you generate XML 
elements without namespace instead of HTML elements, or XML elements in 
the xhtml namespace.

Make sure your output method is either set to html or that your 
definition for the xhtml namespace actually covers all literal result 
elements in all templates inside the XSLT stylesheet.

Those are the most common mishaps leading to the behaviour you described.

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.