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


Java DTMNodeProxy类代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy的典型用法代码示例。如果您正苦于以下问题:Java DTMNodeProxy类的具体用法?Java DTMNodeProxy怎么用?Java DTMNodeProxy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DTMNodeProxy类属于com.sun.org.apache.xml.internal.dtm.ref包,在下文中一共展示了DTMNodeProxy类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toString

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * Return the string value of a Node
 *
 * @param n The Node.
 * @return The string value of the Node
 */
protected static String toString(Node n)
{
  if (n instanceof DTMNodeProxy)
       return ((DTMNodeProxy)n).getStringValue();
  else
  {
    String value = n.getNodeValue();
    if (value == null)
    {
      NodeList nodelist = n.getChildNodes();
      StringBuffer buf = new StringBuffer();
      for (int i = 0; i < nodelist.getLength(); i++)
      {
        Node childNode = nodelist.item(i);
        buf.append(toString(childNode));
      }
      return buf.toString();
    }
    else
      return value;
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:ExsltBase.java

示例2: systemId

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * <code>systemId</code> returns the system id of the node passed as
 * argument. If a node set is passed as argument, the system id of
 * the first node in the set is returned.
 *
 * @param nodeList a <code>NodeList</code> value
 * @return a <code>String</code> value
 */
public static String systemId(NodeList nodeList)
{
  if (nodeList == null || nodeList.getLength() == 0)
    return null;

  Node node = nodeList.item(0);
  int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
  SourceLocator locator = ((DTMNodeProxy)node).getDTM()
    .getSourceLocatorFor(nodeHandler);

  if (locator != null)
    return locator.getSystemId();
  else
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:NodeInfo.java

示例3: publicId

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * <code>publicId</code> returns the public identifier of the node passed as
 * argument. If a node set is passed as argument, the public identifier of
 * the first node in the set is returned.
 *
 * Xalan does not currently record this value, and will return null.
 *
 * @param nodeList a <code>NodeList</code> value
 * @return a <code>String</code> value
 */
public static String publicId(NodeList nodeList)
{
  if (nodeList == null || nodeList.getLength() == 0)
    return null;

  Node node = nodeList.item(0);
  int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
  SourceLocator locator = ((DTMNodeProxy)node).getDTM()
    .getSourceLocatorFor(nodeHandler);

  if (locator != null)
    return locator.getPublicId();
  else
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:NodeInfo.java

示例4: lineNumber

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * <code>lineNumber</code> returns the line number of the node
 * passed as argument. If a node set is passed as argument, the line
 * number of the first node in the set is returned.
 *
 * NOTE: Xalan does not normally record location information for each node.
 * To obtain it, you must set the custom TrAX attribute
 * "http://xml.apache.org/xalan/features/source_location"
 * true in the TransformerFactory before generating the Transformer and executing
 * the stylesheet. Storage cost per node will be noticably increased in this mode.
 *
 * @param nodeList a <code>NodeList</code> value
 * @return an <code>int</code> value. This may be -1 to indicate that the
 * line number is not known.
 */
public static int lineNumber(NodeList nodeList)
{
  if (nodeList == null || nodeList.getLength() == 0)
    return -1;

  Node node = nodeList.item(0);
  int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
  SourceLocator locator = ((DTMNodeProxy)node).getDTM()
    .getSourceLocatorFor(nodeHandler);

  if (locator != null)
    return locator.getLineNumber();
  else
    return -1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:NodeInfo.java

示例5: columnNumber

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * <code>columnNumber</code> returns the column number of the node
 * passed as argument. If a node set is passed as argument, the line
 * number of the first node in the set is returned.
 *
 * NOTE: Xalan does not normally record location information for each node.
 * To obtain it, you must set the custom TrAX attribute
 * "http://xml.apache.org/xalan/features/source_location"
 * true in the TransformerFactory before generating the Transformer and executing
 * the stylesheet. Storage cost per node will be noticably increased in this mode.
 *
 * @param nodeList a <code>NodeList</code> value
 * @return an <code>int</code> value. This may be -1 to indicate that the
 * column number is not known.
 */
public static int columnNumber(NodeList nodeList)
{
  if (nodeList == null || nodeList.getLength() == 0)
    return -1;

  Node node = nodeList.item(0);
  int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
  SourceLocator locator = ((DTMNodeProxy)node).getDTM()
    .getSourceLocatorFor(nodeHandler);

  if (locator != null)
    return locator.getColumnNumber();
  else
    return -1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:NodeInfo.java

示例6: makeNode

import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; //导入依赖的package包/类
/**
 * Create an org.w3c.dom.Node from a node in the tree
 */
public Node makeNode(int index) {
    if (_nodes == null) {
        _nodes = new Node[_namesSize];
    }

    int nodeID = makeNodeIdentity(index);
    if (nodeID < 0) {
        return null;
    }
    else if (nodeID < _nodes.length) {
        return (_nodes[nodeID] != null) ? _nodes[nodeID]
            : (_nodes[nodeID] = new DTMNodeProxy((DTM)this, index));
    }
    else {
        return new DTMNodeProxy((DTM)this, index);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SAXImpl.java


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