XQueryEvaluator.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:xquery-engine 作者:
/**
 * Calculates the key of a node - only depends on the values of the nodes in the tag list
 *
 * @param node Node to compute the key of
 * @param tags List of tags of the node the key depends on
 * @return Key of the node
 */
public static String keyNodeTags(Node node, List<TerminalNode> tags) {
    String key = "";
    NodeList nodes = node.getChildNodes();
    for (TerminalNode tag : tags) {
        for (int i = 0; i < nodes.getLength(); ++i) {
            Node c = nodes.item(i);
            if (c.getNodeName().equals(tag.getText())) {
                try {
                    key += IO.NodesToString(children(c), false);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
    return key;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号