本文整理汇总了Java中com.sun.org.apache.xml.internal.utils.XMLString.fixWhiteSpace方法的典型用法代码示例。如果您正苦于以下问题:Java XMLString.fixWhiteSpace方法的具体用法?Java XMLString.fixWhiteSpace怎么用?Java XMLString.fixWhiteSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xml.internal.utils.XMLString
的用法示例。
在下文中一共展示了XMLString.fixWhiteSpace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchCharactersEvents
import com.sun.org.apache.xml.internal.utils.XMLString; //导入方法依赖的package包/类
/**
* Directly call the
* characters method on the passed ContentHandler for the
* string-value of the given node (see http://www.w3.org/TR/xpath#data-model
* for the definition of a node's string-value). Multiple calls to the
* ContentHandler's characters methods may well occur for a single call to
* this method.
*
* @param nodeHandle The node ID.
* @param ch A non-null reference to a ContentHandler.
*
* @throws org.xml.sax.SAXException
*/
public void dispatchCharactersEvents(
int nodeHandle, org.xml.sax.ContentHandler ch,
boolean normalize)
throws org.xml.sax.SAXException
{
if(normalize)
{
XMLString str = getStringValue(nodeHandle);
str = str.fixWhiteSpace(true, true, false);
str.dispatchCharactersEvents(ch);
}
else
{
int type = getNodeType(nodeHandle);
Node node = getNode(nodeHandle);
dispatchNodeData(node, ch, 0);
// Text coalition -- a DTM text node may represent multiple
// DOM nodes.
if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
{
while( null != (node=logicalNextDOMTextNode(node)) )
{
dispatchNodeData(node, ch, 0);
}
}
}
}
示例2: execute
import com.sun.org.apache.xml.internal.utils.XMLString; //导入方法依赖的package包/类
/**
* Execute the function. The function must return
* a valid object.
* @param xctxt The current execution context.
* @return A valid XObject.
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
XMLString s1 = getArg0AsString(xctxt);
return (XString)s1.fixWhiteSpace(true, true, false);
}