Re: data source as parameter?

"kitchen" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization http://groups.google.com
Message-ID <[email protected]>
Martin Honnen wrote:
> Data source is a rather general term, it is not clear from that term
> what you are asking about. That code with all the JavaScript files and
> libraries is a bit convoluted to understand what you are doing, I guess
> you are passing in a DOM node (e.g. XML DOM document) as a parameter to
> the stylesheet to further process it in the stylesheet as a node set.
> Firefox 1.5 and later (but not Firefox 1.0) support that, yes, as does
> Opera 9. MSXML 3 (and later), the XSLT processors you can use with IE,
> also allows XML DOM nodes as parameters passed in. Firefox 1.5 and later
> and Opera 9 also allow you to pass in an XPathResult
> (<http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult>) you
> would get using the W3C DOM Level 3 XPath API those browsers support.

ok

> There is no general requirement however in the XSLT specification to
> support such parameter types. And in your example you seem to load an
> XML file (e.g. cutecompanies.xml) with script, you can also do that
> within XSLT with the document function XSLT provides (e.g.
>    <xsl:for-each
> select="document('cutecompanies.xml')/data/companies/company">
> ). The document function is a requirement to be supported by any XSLT
> processor to allow loading of XML. Note sure Opera 9.0 currently does.

well, I couldn't use any 'built-in' xsl functionality to load the
document, as I needed to use the document elsewhere (and it's generated
by a fairly expensive server-side process, so calling it up multiple
times just isn't useful :) so I had to think of another way to do it.

Is there a way to specify a document to be included from javascript?
(perhaps found in javascript variable somewhere)  The way I did it
seems to work, but I want to make sure I'm doing things 'correctly' ..
so I don't get started off with this XSLTProcessor stuff on a bad foot
:)

Thanks for your reply.

-Jeremy
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.