>From keshlam(_at_)us(_dot_)ibm(_dot_)com Wed Dec 3 08:16:15 2003
In-Reply-To: <200312022226(_dot_)RAA12493(_at_)biglist(_dot_)com>
Subject: How to detect XSLT extension usage at runtime?
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: Joseph Kesselman <keshlam(_at_)us(_dot_)ibm(_dot_)com>
Date: Wed, 3 Dec 2003 08:13:24 -0500
Since you're asking specifically abut Xalan-J features, you might get
better/faster answers on Xalan's own mailing list(s). For info about how to
subscribe, see
http://xml.apache.org/mail.html#xalan-j-users
http://xml.apache.org/mail.html#xalan-dev
Since its XSLTC implementation has good performance but
doesn't support extensions
XSLTC (compiled mode) does now support extension functions (though not
extension elements). See
http://xml.apache.org/xalan-j/extensions_xsltc.html
Is there an accurate programmatic way to
examine a sheet at runtime to determine whether or not it is using
extensions, so I can switch between compiled/interpreted mode?
I don't think there's a query built into Xalan which will answer this
question, if that's what you're asking. You'd have to do it the same way an
XSLT processor does it -- scan the stylesheet searching for the XSLT syntax
which invokes an extension. Theoretically that query could leverage our
existing XSLT parser and internal parse tree, but those aren't really
public APIs.
It might make sense to suggest that Xalan itself be made intelligent enough
to detect features that are supported in interpretive mode but not compiled
mode and automatically fall back to interpretive rather than issuing an
error to the user. (Though the effort spent on that might be better
invested in figuring out how to add the missing features to XSLTC mode...)
If you want to pursue that idea, it's definitely a topic for the xalan-dev
list.
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk
Sender: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Precedence: bulk
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
X-MailLoop: 1
--
======================================================================
B. Tommie Usdin
mailto:btusdin(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Phone: 301/315-9631
Suite 207 Direct Line: 301/315-9634
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in XML and SGML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list