Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: newbie xsl:processing-instruction question >Thread Next - Re: newbie xsl:processing-instruction question Re: newbie xsl:processing-instruction questionTo: NULL Date: 9/7/2007 6:49:00 PM Martin Welch wrote: > I tried your javascript trick (?) and I got: > > ---- > <?xml-stylesheet version="1.0" type="text/xsl" href="page.xslt"?> > > <result /> > ---- > > However I don't get: > > <?xml version='1.0' encoding="utf-8" ?> That is the XML declaration and it is not part of the DOM object model so you can't see that by serializing the DOM document object, whether that DOM document is the result of an XSLT transformation or just a static XML document. > I'd hoped that the output of the transform would also be transformed > into html by FireFox (which is the purpose of page.xslt): > > ------------------ > <?xml version='1.0' encoding="utf-8" ?> > <?xml-stylesheet version="1.0" type="text/xsl" href="page.xslt"?> > > <result /> > ------------------ > > Can browsers perform this two stage transform? Neither Firefox nor IE nor Opera do as far as I know, they take the processing instruction in the first XML document and apply that transformation and render the result. Opera and Firefox can at least render it as XML while IE even treats the result of an XSLT transformation as HTML, whatever the output method is. If you want to chain transformations in the browser you have to script them, Mozilla's XSLT processor API exposed to JavaScript is described here: <URL:http://developer.mozilla.org/en/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations> Opera 9 also implements that API, as will Safari 3 as far as I know. IE uses MSXML for XML parsing and XSLT transformations, it is also scriptable but has a different API. -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
