本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getStylesheetDOM方法的典型用法代码示例。如果您正苦于以下问题:Java TemplatesImpl.getStylesheetDOM方法的具体用法?Java TemplatesImpl.getStylesheetDOM怎么用?Java TemplatesImpl.getStylesheetDOM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl
的用法示例。
在下文中一共展示了TemplatesImpl.getStylesheetDOM方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: documentF
import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; //导入方法依赖的package包/类
/**
* Interprets the arguments passed from the document() function (see
* com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
* iterator containing the requested nodes. Builds a union-iterator if
* several documents are requested.
* 1 arguments arg. document(Obj) call
*/
public static DTMAxisIterator documentF(Object arg, String xslURI,
AbstractTranslet translet, DOM dom)
throws TransletException {
try {
if (arg instanceof String) {
if (xslURI == null )
xslURI = "";
String baseURI = xslURI;
if (!SystemIDResolver.isAbsoluteURI(xslURI))
baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI);
String href = (String)arg;
if (href.length() == 0) {
href = "";
// %OPT% Optimization to cache the stylesheet DOM.
// The stylesheet DOM is built once and cached
// in the Templates object.
TemplatesImpl templates = (TemplatesImpl)translet.getTemplates();
DOM sdom = null;
if (templates != null) {
sdom = templates.getStylesheetDOM();
}
// If the cached dom exists, we need to migrate it
// to the new DTMManager and create a DTMAxisIterator
// for the document.
if (sdom != null) {
return document(sdom, translet, dom);
}
else {
return document(href, baseURI, translet, dom, true);
}
}
else {
return document(href, baseURI, translet, dom);
}
} else if (arg instanceof DTMAxisIterator) {
return document((DTMAxisIterator)arg, null, translet, dom);
} else {
final String err = "document("+arg.toString()+")";
throw new IllegalArgumentException(err);
}
} catch (Exception e) {
throw new TransletException(e);
}
}