Class XalanUtil
- java.lang.Object
-
- org.apache.taglibs.standard.tag.common.xml.XalanUtil
-
public class XalanUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static javax.xml.parsers.DocumentBuilderFactory
dbf
-
Constructor Summary
Constructors Constructor Description XalanUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.Object
coerceToJava(org.apache.xpath.objects.XObject xo)
Return the Java value corresponding to an XPath result.static org.apache.xpath.XPathContext
getContext(javax.servlet.jsp.tagext.Tag child, javax.servlet.jsp.PageContext pageContext)
Return the XPathContext to be used for evaluating expressions.private static org.w3c.dom.Document
newEmptyDocument()
Create a new empty document.
-
-
-
Method Detail
-
getContext
public static org.apache.xpath.XPathContext getContext(javax.servlet.jsp.tagext.Tag child, javax.servlet.jsp.PageContext pageContext)
Return the XPathContext to be used for evaluating expressions. If the child is nested withing a forEach tag its iteration context is used. Otherwise, a new context is created based on an empty Document.- Parameters:
child
- the tag whose context should be returnedpageContext
- the current page context- Returns:
- the XPath evaluation context
-
newEmptyDocument
private static org.w3c.dom.Document newEmptyDocument()
Create a new empty document. This method always allocates a new document as its root node might be exposed to other tags and potentially be mutated.- Returns:
- a new empty document
-
coerceToJava
static java.lang.Object coerceToJava(org.apache.xpath.objects.XObject xo) throws javax.xml.transform.TransformerException
Return the Java value corresponding to an XPath result.- Parameters:
xo
- the XPath type- Returns:
- the corresponding Java value per the JSTL mapping rules
- Throws:
javax.xml.transform.TransformerException
- if there was a problem converting the type
-
-