by M. David Peterson
From the latest weekly release of Opera (v 9.01 apparently) we discover,
8518,3466,383 - Desktop Team - by Desktop Team
Added support for exls:node-set in XSLT
NOTE: I can only hope that by exls:nose-set, they mean exsl:node-set
. If no, then this
present a problem, but an easily fixed problem, which is always a good thing.
Of course, the ability to combine the document function with the EXSLT node-set() function can be a powerful tool, as this allows the ability to access data that is outside the current context document being processed, to then dice and splice this data into variouses pieces, processing dynamically generated XML fragments via the exsl:node-set function. None-the-less, this (exsl:node-set) is still an EXTREMELY nice addition in which I am truly grateful to the folks at Opera for adding to the XSLT mix.
> Opera... Thanks for the exsl:node-set implementation.
Yeah right. Though you seem to hail the corss-browser abilities of using XSLT, this one is not amongst them, considering:
Firefox: not supported. Why? I don't know. They don't provide their own alternative either. In fact, it gives a pretty ugly error:
[Exception... "Component returned failure code: 0x8060000e [nsIXSLTProcessor.transformToDocument]" nsresult: "0x8060000e (<unknown>)" location: "JS frame :: "....
Microsoft has its own extension functions (sounds familiar? JS stories repeat themselves for new standards... alas) and for exslt it will return the following:
Namespace 'http://exslt.org/common' does not contain any functions.
<xsl:if test="system-property('xsl:vendor') = 'Opera'">
... you can use exslt:node-set() here....
Opera supporting exslt? Nice gesture, but will be close to useless as long as Firefox, and more specifically, IE, has no normal way of dealing with it.
But I do have another suggestion: using document() the other way in Opera. I haven't tested this myself, but knowing that XSLT is in fact valid XML, you can turn the external document into a XSLT stylesheet, with one large variable. Now you can use the combination of or together with exslt:node-set($yourdoc-variable) to get to your document. For other browsers you can still access the same data, just change your root-XPath a bit.
Ok, there's one glitch that will proof unsurpassable: and cannot be used with AVT (Attribute Value Templates). Hence, the variability of using document() falls back because you have to hardcode your documents for use in Opera (or you have to resort to some sophisticated tricks, which are all well-documented on the xsl-list).
|M. David Peterson
>> using document() the other way in Opera
Which other way would that be? What you are refering to is,
which would then allow you to reference the transformation file itself.
There's one problem, though: There *IS NO* document() function in Opera.
>> (or you have to resort to some sophisticated tricks, which are all well-documented on the xsl-list). <<
Yeah, I'm aware of XSL-List[ http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.biglist.com%2Flists%2Fxsl-list%2Farchives%2F+%22M.+David+Peterson%22 ], but thanks for taking the time to provide the information none-the-less.