本文整理汇总了Java中org.apache.xalan.templates.ElemTemplateElement.appendChild方法的典型用法代码示例。如果您正苦于以下问题:Java ElemTemplateElement.appendChild方法的具体用法?Java ElemTemplateElement.appendChild怎么用?Java ElemTemplateElement.appendChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xalan.templates.ElemTemplateElement
的用法示例。
在下文中一共展示了ElemTemplateElement.appendChild方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例2: 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;
}
示例3: startElement
import org.apache.xalan.templates.ElemTemplateElement; //导入方法依赖的package包/类
/**
* Receive notification of the start of an xsl:attribute-set 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.
*
* @see org.apache.xalan.processor.StylesheetHandler#startElement
* @see org.xml.sax.ContentHandler#startElement
* @see org.xml.sax.ContentHandler#endElement
* @see org.xml.sax.Attributes
*/
public void startElement(
StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
throws org.xml.sax.SAXException
{
ElemAttributeSet eat = new ElemAttributeSet();
eat.setLocaterInfo(handler.getLocator());
try
{
eat.setPrefixes(handler.getNamespaceSupport());
}
catch(TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
eat.setDOMBackPointer(handler.getOriginatingNode());
setPropertiesFromAttributes(handler, rawName, attributes, eat);
handler.getStylesheet().setAttributeSet(eat);
// handler.pushElemTemplateElement(eat);
ElemTemplateElement parent = handler.getElemTemplateElement();
parent.appendChild(eat);
handler.pushElemTemplateElement(eat);
}
示例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 the current template element.
*
* @throws org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
*/
protected void appendAndPush(
StylesheetHandler handler, ElemTemplateElement elem)
throws org.xml.sax.SAXException
{
ElemTemplateElement parent = handler.getElemTemplateElement();
if(null != parent) // defensive, for better multiple error reporting. -sb
{
parent.appendChild(elem);
handler.pushElemTemplateElement(elem);
}
}
示例5: startNonText
import org.apache.xalan.templates.ElemTemplateElement; //导入方法依赖的package包/类
/**
* Receive notification of the start of the non-text event. This
* is sent to the current processor when any non-text event occurs.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
*/
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException
{
if (this == handler.getCurrentProcessor())
{
handler.popProcessor();
}
int nChars = m_accumulator.length();
if ((nChars > 0)
&& ((null != m_xslTextElement)
||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator))
|| handler.isSpacePreserve())
{
ElemTextLiteral elem = new ElemTextLiteral();
elem.setDOMBackPointer(m_firstBackPointer);
elem.setLocaterInfo(handler.getLocator());
try
{
elem.setPrefixes(handler.getNamespaceSupport());
}
catch(TransformerException te)
{
throw new org.xml.sax.SAXException(te);
}
boolean doe = (null != m_xslTextElement)
? m_xslTextElement.getDisableOutputEscaping() : false;
elem.setDisableOutputEscaping(doe);
elem.setPreserveSpace(true);
char[] chars = new char[nChars];
m_accumulator.getChars(0, nChars, chars, 0);
elem.setChars(chars);
ElemTemplateElement parent = handler.getElemTemplateElement();
parent.appendChild(elem);
}
m_accumulator.setLength(0);
m_firstBackPointer = null;
}