Altova Mailing List Archives
>comp.text.xml Archive Home
>Thread Prev - Re: Feature detection in XSL template
>Thread Next - Re: Feature detection in XSL template
Re: Feature detection in XSL template
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.