Re: How to make an XMLDocument as a parameter in a XSLT transformation ?

Martin Honnen <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization Liberty Development
Message-ID <[email protected]>

[email protected] wrote:

> I'm trying to make an XML available as a parameter in a XSLT
> transformation (use case like mixing up business data to be transformed
> to a HTML GUI with say language dependent text data for labels' texts
> or something).
> 
> I'm quite new to the Mozilla API for XML but I know a thing or two
> about MSMXL where i used this approach that has often prooved simple
> and useful.
> 
> Is this possible some way (a way in which i should be able to code the
> xsl only once for BOTH, msxml and Mozilla)? Or are there other
> approaches allowing similar usage?

You could pass in the URL of the secondary XML to the stylesheet and 
then in the stylesheet use the XSLT function named document e.g.
   <xsl:param name="xmlURL" />

   <xsl:value-of select="document($xmlURL)//text[@id=current()/@id]"/>

That approach should be portable between XSLT processors.

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
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.