Altova Mailing List Archives


Re: Feature detection in XSL template

From: "Andy Dingley <dingbat@----------.--->" <dingbat@----------.--->
To: NULL
Date: 5/23/2006 6:43:00 AM

VK wrote:
> Andy Dingley <dingbat@c...> wrote:
> > VK wrote:
> > > Is there any possibility to detect any of UA's feature in the template?
> >
> > No, test for them outside the XSLT-processor and pass a flag into the
> > stylesheet.
>
> I still prefer Martin's solution (if it works cross IE/Gecko)

The problem with that is that it only tells you "where you are", once
you've arrived there.  If your intention is to serve text/html output
vs. application/xml (or a variant), then by the time you make this
test, you've already completed the HTTP transfer and its headers.

As "All XSLT 1.0 processors are basically equal"  (to an amazingly
consistent level for any multi-vendor software product) then you're
left with the question _why_ you'd want to test and discover which
processor you're running under.  There's a very narrow window left to
you between "It's too late to do anything about it" and "It doesn't
matter anyway".

I certainly wouldn't build code on the lines of "If I'm running under
XSLT processor <foo>, then assume that DOM feature <bar> is usable".
That's very far from maintainable over time and this is an area
historically of great instability.

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.