本文整理汇总了Java中org.apache.xalan.templates.ElemTemplateElement类的典型用法代码示例。如果您正苦于以下问题:Java ElemTemplateElement类的具体用法?Java ElemTemplateElement怎么用?Java ElemTemplateElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElemTemplateElement类属于org.apache.xalan.templates包,在下文中一共展示了ElemTemplateElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ancestorIsOk
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Verify that a literal result belongs to a result element, a variable,
* or a parameter.
*/
boolean ancestorIsOk(ElemTemplateElement child)
{
while (child.getParentElem() != null && !(child.getParentElem() instanceof ElemExsltFunction))
{
ElemTemplateElement parent = child.getParentElem();
if (parent instanceof ElemExsltFuncResult
|| parent instanceof ElemVariable
|| parent instanceof ElemParam
|| parent instanceof ElemMessage)
return true;
child = parent;
}
return false;
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:20,代码来源:ProcessorExsltFunction.java
示例2: getElemVersion
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
private double getElemVersion()
{
ElemTemplateElement elem = getElemTemplateElement();
double version = -1;
while ((version == -1 || version == Constants.XSLTVERSUPPORTED) && elem != null)
{
try{
version = Double.valueOf(elem.getXmlVersion()).doubleValue();
}
catch (Exception ex)
{
version = -1;
}
elem = elem.getParentElem();
}
return (version == -1)? Constants.XSLTVERSUPPORTED : version;
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:18,代码来源:StylesheetHandler.java
示例3: startElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Verify that the func:result element does not appear within a variable,
* parameter, or another func:result, and that it belongs to a func:function
* element.
*/
public void startElement(
StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
throws SAXException
{
String msg = "";
super.startElement(handler, uri, localName, rawName, attributes);
ElemTemplateElement ancestor = handler.getElemTemplateElement().getParentElem();
while (ancestor != null && !(ancestor instanceof ElemExsltFunction))
{
if (ancestor instanceof ElemVariable
|| ancestor instanceof ElemParam
|| ancestor instanceof ElemExsltFuncResult)
{
msg = "func:result cannot appear within a variable, parameter, or another func:result.";
handler.error(msg, new SAXException(msg));
}
ancestor = ancestor.getParentElem();
}
if (ancestor == null)
{
msg = "func:result must appear in a func:function element";
handler.error(msg, new SAXException(msg));
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:31,代码来源:ProcessorExsltFuncResult.java
示例4: appendAndPush
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Append the current template element to the current
* template element, and then push it onto the current template
* element stack.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param elem non-null reference to a {@link org.apache.xalan.templates.ElemText}.
*
* @throws org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
*/
protected void appendAndPush(
StylesheetHandler handler, ElemTemplateElement elem)
throws org.xml.sax.SAXException
{
// Don't push this element onto the element stack.
ProcessorCharacters charProcessor =
(ProcessorCharacters) handler.getProcessorFor(null, "text()", "text");
charProcessor.setXslTextElement((ElemText) elem);
ElemTemplateElement parent = handler.getElemTemplateElement();
parent.appendChild(elem);
elem.setDOMBackPointer(handler.getOriginatingNode());
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:28,代码来源:ProcessorText.java
示例5: processAVT
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_AVT into
* a AVT value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value Should be an Attribute Value Template string.
*
* @return An AVT object that may be used to evaluate the Attribute Value Template.
*
* @throws org.xml.sax.SAXException which will wrap a
* {@link javax.xml.transform.TransformerException}, if there is a syntax error
* in the attribute value template string.
*/
AVT processAVT(
StylesheetHandler handler, String uri, String name, String rawName, String value,
ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
AVT avt = new AVT(handler, uri, name, rawName, value, owner);
return avt;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:34,代码来源:XSLTAttributeDef.java
示例6: processCDATA
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_CDATA into
* a String value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value non-null string reference.
*
* @return The value argument.
*
* @throws org.xml.sax.SAXException.
*/
Object processCDATA(StylesheetHandler handler, String uri, String name,
String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
if (getSupportsAVT()) {
try
{
AVT avt = new AVT(handler, uri, name, rawName, value, owner);
return avt;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
} else {
return value;
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:33,代码来源:XSLTAttributeDef.java
示例7: processEXPR
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_EXPR into
* an XPath value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value An XSLT expression string.
*
* @return an XPath object that may be used for evaluation.
*
* @throws org.xml.sax.SAXException that wraps a
* {@link javax.xml.transform.TransformerException} if the expression
* string contains a syntax error.
*/
Object processEXPR(
StylesheetHandler handler, String uri, String name, String rawName, String value,
ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
XPath expr = handler.createXPath(value, owner);
return expr;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:34,代码来源:XSLTAttributeDef.java
示例8: processPATTERN
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_PATTERN into
* an XPath match pattern value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value A match pattern string.
*
* @return An XPath pattern that may be used to evaluate the XPath.
*
* @throws org.xml.sax.SAXException that wraps a
* {@link javax.xml.transform.TransformerException} if the match pattern
* string contains a syntax error.
*/
Object processPATTERN(
StylesheetHandler handler, String uri, String name, String rawName, String value,
ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
XPath pattern = handler.createMatchPatternXPath(value, owner);
return pattern;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:34,代码来源:XSLTAttributeDef.java
示例9: processQNAME
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_QNAME into a QName value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value A string that represents a potentially prefix qualified name.
* @param owner
*
* @return A QName object if this attribute does not support AVT's. Otherwise, an AVT
* is returned.
*
* @throws org.xml.sax.SAXException if the string contains a prefix that can not be
* resolved, or the string contains syntax that is invalid for a qualified name.
*/
Object processQNAME(
StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
QName qname = new QName(value, handler, true);
return qname;
}
catch (IllegalArgumentException ie)
{
// thrown by QName constructor
handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie);
return null;
}
catch (RuntimeException re) {
// thrown by QName constructor
handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re);
return null;
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:39,代码来源:XSLTAttributeDef.java
示例10: endElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Receive notification of the end of an element.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param localName The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
*/
public void endElement(
StylesheetHandler handler, String uri, String localName, String rawName)
throws org.xml.sax.SAXException
{
ElemTemplateElement elem = handler.getElemTemplateElement();
if (elem instanceof ElemLiteralResult)
{
if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet())
{
handler.popStylesheet();
}
}
super.endElement(handler, uri, localName, rawName);
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:26,代码来源:ProcessorLRE.java
示例11: executeChildTemplates
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Execute each of the children of a template element. This method
* is only for extension use.
*
* @param elem The ElemTemplateElement that contains the children
* that should execute.
* NEEDSDOC @param context
* @param mode The current mode.
* @param handler The ContentHandler to where the result events
* should be fed.
*
* @throws TransformerException
* @xsl.usage advanced
*/
public void executeChildTemplates(
ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler)
throws TransformerException
{
XPathContext xctxt = m_xcontext;
try
{
if(null != mode)
pushMode(mode);
xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context));
executeChildTemplates(elem, handler);
}
finally
{
xctxt.popCurrentNode();
// I'm not sure where or why this was here. It is clearly in
// error though, without a corresponding pushMode().
if (null != mode)
popMode();
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:39,代码来源:TransformerImpl.java
示例12: getInstruction
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
static String getInstruction(ElemTemplateElement node) {
final String name = node.getNodeName();
if (node instanceof ElemLiteralResult) {
return name;
} else if (name != null && name.indexOf(':') == -1) {
return "xsl:" + name;
}
return name;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:XalanStyleFrame.java
示例13: appendAndPush
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Must include; super doesn't suffice!
*/
protected void appendAndPush(
StylesheetHandler handler, ElemTemplateElement elem)
throws SAXException
{
//System.out.println("ProcessorFunction appendAndPush()" + elem);
super.appendAndPush(handler, elem);
//System.out.println("originating node " + handler.getOriginatingNode());
elem.setDOMBackPointer(handler.getOriginatingNode());
handler.getStylesheet().setTemplate((ElemTemplate) elem);
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:14,代码来源:ProcessorExsltFunction.java
示例14: endElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* End an ElemExsltFunction, and verify its validity.
*/
public void endElement(
StylesheetHandler handler, String uri, String localName, String rawName)
throws SAXException
{
ElemTemplateElement function = handler.getElemTemplateElement();
validate(function, handler); // may throw exception
super.endElement(handler, uri, localName, rawName);
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:12,代码来源:ProcessorExsltFunction.java
示例15: createMatchPatternXPath
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an expression string into an XPath.
*
* @param str A non-null reference to a valid or invalid match pattern string.
*
* @return A non-null reference to an XPath object that represents the string argument.
*
* @throws javax.xml.transform.TransformerException if the pattern can not be processed.
* @see <a href="http://www.w3.org/TR/xslt#patterns">Section 5.2 Patterns in XSLT Specification</a>
*/
XPath createMatchPatternXPath(String str, ElemTemplateElement owningTemplate)
throws javax.xml.transform.TransformerException
{
ErrorListener handler = m_stylesheetProcessor.getErrorListener();
XPath xpath = new XPath(str, owningTemplate, this, XPath.MATCH, handler,
m_funcTable);
// Visit the expression, registering namespaces for any extension functions it includes.
xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot()));
return xpath;
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:StylesheetHandler.java
示例16: getElemTemplateElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Get the current ElemTemplateElement at the top of the stack.
* @return Valid ElemTemplateElement, which may be null.
*/
ElemTemplateElement getElemTemplateElement()
{
try
{
return (ElemTemplateElement) m_elems.peek();
}
catch (java.util.EmptyStackException ese)
{
return null;
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:StylesheetHandler.java
示例17: pushElemTemplateElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Push the current XSLTElementProcessor to the top of the stack. As a
* side-effect, set the document order index (simply because this is a
* convenient place to set it).
*
* @param elem Should be a non-null reference to the intended current
* template element.
*/
void pushElemTemplateElement(ElemTemplateElement elem)
{
if (elem.getUid() == -1)
elem.setUid(nextUid());
m_elems.push(elem);
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:StylesheetHandler.java
示例18: startElement
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Receive notification of the start of an xsl:output element.
*
* @param handler The calling StylesheetHandler/TemplatesBuilder.
* @param uri The Namespace URI, or the empty string if the
* element has no Namespace URI or if Namespace
* processing is not being performed.
* @param localName The local name (without prefix), or the
* empty string if Namespace processing is not being
* performed.
* @param rawName The raw XML 1.0 name (with prefix), or the
* empty string if raw names are not available.
* @param attributes The attributes attached to the element. If
* there are no attributes, it shall be an empty
* Attributes object.
*
* @throws org.xml.sax.SAXException
*/
public void startElement(
StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
throws org.xml.sax.SAXException
{
// Hmmm... for the moment I don't think I'll have default properties set for this. -sb
m_outputProperties = new OutputProperties();
m_outputProperties.setDOMBackPointer(handler.getOriginatingNode());
m_outputProperties.setLocaterInfo(handler.getLocator());
m_outputProperties.setUid(handler.nextUid());
setPropertiesFromAttributes(handler, rawName, attributes, this);
// Access this only from the Hashtable level... we don't want to
// get default properties.
String entitiesFileName =
(String) m_outputProperties.getProperties().get(OutputPropertiesFactory.S_KEY_ENTITIES);
if (null != entitiesFileName)
{
try
{
String absURL = SystemIDResolver.getAbsoluteURI(entitiesFileName,
handler.getBaseIdentifier());
m_outputProperties.getProperties().put(OutputPropertiesFactory.S_KEY_ENTITIES, absURL);
}
catch(TransformerException te)
{
handler.error(te.getMessage(), te);
}
}
handler.getStylesheet().setOutput(m_outputProperties);
ElemTemplateElement parent = handler.getElemTemplateElement();
parent.appendChild(m_outputProperties);
m_outputProperties = null;
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:57,代码来源:ProcessorOutputElem.java
示例19: processCHAR
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_CHAR into
* a Character value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value Should be a string with a length of 1.
*
* @return Character object.
*
* @throws org.xml.sax.SAXException if the string is not a length of 1.
*/
Object processCHAR(
StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
if (getSupportsAVT()) {
try
{
AVT avt = new AVT(handler, uri, name, rawName, value, owner);
// If an AVT wasn't used, validate the value
if ((avt.isSimple()) && (value.length() != 1)) {
handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null);
return null;
}
return avt;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
} else {
if (value.length() != 1)
{
handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null);
return null;
}
return new Character(value.charAt(0));
}
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:45,代码来源:XSLTAttributeDef.java
示例20: processENUM
import org.apache.xalan.templates.ElemTemplateElement; //导入依赖的package包/类
/**
* Process an attribute string of type T_ENUM into a int value.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param uri The Namespace URI, or an empty string.
* @param name The local name (without prefix), or empty string if not namespace processing.
* @param rawName The qualified name (with prefix).
* @param value non-null string that represents an enumerated value that is
* valid for this element.
* @param owner
*
* @return An Integer representation of the enumerated value if this attribute does not support
* AVT. Otherwise, and AVT is returned.
*/
Object processENUM(StylesheetHandler handler, String uri, String name,
String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
AVT avt = null;
if (getSupportsAVT()) {
try
{
avt = new AVT(handler, uri, name, rawName, value, owner);
// If this attribute used an avt, then we can't validate at this time.
if (!avt.isSimple()) return avt;
}
catch (TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
}
int retVal = this.getEnum(value);
if (retVal == StringToIntTable.INVALID_KEY)
{
StringBuffer enumNamesList = getListOfEnums();
handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null);
return null;
}
if (getSupportsAVT()) return avt;
else return new Integer(retVal);
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:48,代码来源:XSLTAttributeDef.java
注:本文中的org.apache.xalan.templates.ElemTemplateElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论