当前位置: 首页>>代码示例>>Java>>正文


Java XMLString.fixWhiteSpace方法代码示例

本文整理汇总了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);
                }
        }
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:DOM2DTM.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:FuncNormalizeSpace.java


注:本文中的com.sun.org.apache.xml.internal.utils.XMLString.fixWhiteSpace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。