xalan usage in taglibs

Matthew Broadhead <[email protected]> Sun, 26 Nov 2017 15:32:35 +0100
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
Hi,
I am currently evaluating whether the Xalan dependency can be dropped 
from taglibs and replaced with javax.xml.*.

The reason for this is a conflict which occurs when I have Apache Fop as 
a dependency:
java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault 
cannot be cast to org.apache.xml.dtm.DTMManager
     at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137)
     at org.apache.xpath.XPathContext.<init>(XPathContext.java:102)
     at org.apache.xpath.XPathContext.<init>(XPathContext.java:349)
     at org.apache.xpath.XPathContext.<init>(XPathContext.java:337)
     at 
org.apache.xalan.transformer.TransformerImpl.<init>(TransformerImpl.java:397)
     at 
org.apache.xalan.templates.StylesheetRoot.newTransformer(StylesheetRoot.java:200)

In org.apache.taglibs.standard.tag.common.xml it seems like 
org.apache.xpath.XPath could be replaced with 
javax.xml.xpath.XPathExpression.

But the thing I don't understand is the method getContext in 
org.apache.taglibs.standard.tag.common.xml.XalanUtil uses a 
VariableStack and returns an XPathContext.  I am not sure how they fit 
into the SAX (?) model.

Can anyone shed some light on the inner workings of this function?

Regards,
Matthew