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


Java DTMAxisIterator.next方法代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next方法的典型用法代码示例。如果您正苦于以下问题:Java DTMAxisIterator.next方法的具体用法?Java DTMAxisIterator.next怎么用?Java DTMAxisIterator.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xml.internal.dtm.DTMAxisIterator的用法示例。


在下文中一共展示了DTMAxisIterator.next方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: document

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
private static DTMAxisIterator document(DTMAxisIterator arg1,
                                        String baseURI,
                                        AbstractTranslet translet, DOM dom)
throws Exception
{
    UnionIterator union = new UnionIterator(dom);
    int node = DTM.NULL;

    while ((node = arg1.next()) != DTM.NULL) {
        String uri = dom.getStringValueX(node);
        //document(node-set) if true;  document(node-set,node-set) if false
        if (baseURI  == null) {
           baseURI = dom.getDocumentURI(node);
           if (!SystemIDResolver.isAbsoluteURI(baseURI))
                baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI);
        }
        union.addIterator(document(uri, baseURI, translet, dom));
    }
    return(union);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:LoadDocument.java

示例2: compare

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * Utility function: node-set/node-set compare.
 */
public static boolean compare(DTMAxisIterator left, DTMAxisIterator right,
                              int op, DOM dom) {
    int lnode;
    left.reset();

    while ((lnode = left.next()) != DTMAxisIterator.END) {
        final String lvalue = dom.getStringValueX(lnode);

        int rnode;
        right.reset();
        while ((rnode = right.next()) != DTMAxisIterator.END) {
            // String value must be the same if both nodes are the same
            if (lnode == rnode) {
                if (op == Operators.EQ) {
                    return true;
                } else if (op == Operators.NE) {
                    continue;
                }
            }
            if (compareStrings(lvalue, dom.getStringValueX(rnode), op,
                               dom)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:BasisLibrary.java

示例3: documentF

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * Interprets the arguments passed from the document() function (see
 * com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
 * iterator containing the requested nodes. Builds a union-iterator if
 * several documents are requested.
 * 2 arguments arg1 and arg2.  document(Obj, node-set) call
 */
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2,
                        String xslURI, AbstractTranslet translet, DOM dom)
throws TransletException {
    String baseURI = null;
    final int arg2FirstNode = arg2.next();
    if (arg2FirstNode == DTMAxisIterator.END) {
        //  the second argument node-set is empty
        return EmptyIterator.getInstance();
    } else {
        //System.err.println("arg2FirstNode name: "
        //                   + dom.getNodeName(arg2FirstNode )+"["
        //                   +Integer.toHexString(arg2FirstNode )+"]");
        baseURI = dom.getDocumentURI(arg2FirstNode);
        if (!SystemIDResolver.isAbsoluteURI(baseURI))
           baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI);
    }

    try {
        if (arg1 instanceof String) {
            if (((String)arg1).length() == 0) {
                return document(xslURI, "", translet, dom);
            } else {
                return document((String)arg1, baseURI, translet, dom);
            }
        } else if (arg1 instanceof DTMAxisIterator) {
            return document((DTMAxisIterator)arg1, baseURI, translet, dom);
        } else {
            final String err = "document("+arg1.toString()+")";
            throw new IllegalArgumentException(err);
        }
    } catch (Exception e) {
        throw new TransletException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:LoadDocument.java

示例4: copy

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
public void copy(DTMAxisIterator nodes, SerializationHandler handler)
        throws TransletException
{
    int node;
    while ((node = nodes.next()) != DTM.NULL) {
        _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:MultiDOM.java

示例5: sumF

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * XSLT Standard function sum(node-set).
 * stringToDouble is inlined
 */
public static double sumF(DTMAxisIterator iterator, DOM dom) {
    try {
        double result = 0.0;
        int node;
        while ((node = iterator.next()) != DTMAxisIterator.END) {
            result += Double.parseDouble(dom.getStringValueX(node));
        }
        return result;
    }
    catch (NumberFormatException e) {
        return Double.NaN;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:BasisLibrary.java

示例6: copy

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * Copy a node-set to an output handler
 */
public void copy(DTMAxisIterator nodes, SerializationHandler handler)
    throws TransletException
{
    int node;
    while ((node = nodes.next()) != DTM.NULL) {
        copy(node, handler);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SAXImpl.java

示例7: makeNodeList

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
public NodeList makeNodeList(DTMAxisIterator iter) {
    int index = iter.next();
    if (index == DTM.NULL) {
        return new DTMAxisIterNodeList(null, null);
    }
    iter.reset();
    return _adapters[getDTMId(index)].makeNodeList(iter);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:MultiDOM.java

示例8: init

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * Evaluate the reference to the <code>key</code> or <code>id</code>
 * function with the context specified by {@link #setStartNode(int)}
 * and set up this iterator to iterate over the DTM nodes that are
 * to be returned.
 */
protected void init() {
    super.init();
    _position = 0;

    // All nodes retrieved are in the same document
    int rootHandle = _dom.getAxisIterator(Axis.ROOT)
                              .setStartNode(_startNode).next();

    // Is the argument not a node set?
    if (_keyValueIterator == null) {
        // Look up nodes returned for the single string argument
        _nodes = lookupNodes(rootHandle, _keyValue);

        if (_nodes == null) {
            _nodes = EMPTY_NODES;
        }
    } else {
        DTMAxisIterator keyValues = _keyValueIterator.reset();
        int retrievedKeyValueIdx = 0;
        boolean foundNodes = false;

        _nodes = null;

        // For each node in the node set argument, get the string value
        // and look up the nodes returned by key or id for that string
        // value.  If at most one string value has nodes associated,
        // the nodes will be stored in _nodes; otherwise, the nodes
        // will be placed in a heap.
        for (int keyValueNode = keyValues.next();
             keyValueNode != DTMAxisIterator.END;
             keyValueNode = keyValues.next()) {

            String keyValue = BasisLibrary.stringF(keyValueNode, _dom);

            IntegerArray nodes = lookupNodes(rootHandle, keyValue);

            if (nodes != null) {
                if (!foundNodes) {
                    _nodes = nodes;
                    foundNodes = true;
                } else {
                    if (_nodes != null) {
                        addHeapNode(new KeyIndexHeapNode(_nodes));
                        _nodes = null;
                    }
                    addHeapNode(new KeyIndexHeapNode(nodes));
                }
            }
        }

        if (!foundNodes) {
            _nodes = EMPTY_NODES;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:62,代码来源:KeyIndex.java

示例9: getSingleNode

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入方法依赖的package包/类
/**
 * Utility function: used with nth position filters to convert a sequence
 * of nodes to just one single node (the one at position n).
 */
public static DTMAxisIterator getSingleNode(DTMAxisIterator iterator) {
    int node = iterator.next();
    return(new SingletonIterator(node));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:BasisLibrary.java


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