private Set getNodeSet(List nodeFilters) { if (xi.isNeedsToBeExpanded()) { XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(xi.getSubNode())); } Set inputSet = new LinkedHashSet(); XMLUtils.getSet(xi.getSubNode(), inputSet, null, !xi.isExcludeComments()); Set nodeSet = new LinkedHashSet(); Iterator i = inputSet.iterator(); while (i.hasNext()) { Node currentNode = (Node) i.next(); Iterator it = nodeFilters.iterator(); boolean skipNode = false; while (it.hasNext() && !skipNode) { NodeFilter nf = (NodeFilter) it.next(); if (nf.isNodeInclude(currentNode) != 1) { skipNode = true; } } if (!skipNode) { nodeSet.add(currentNode); } } return nodeSet; } }
protected void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { if (!input.isNeedsToBeExpanded() || inclusiveNSSet.isEmpty() || inclusiveNSSet.isEmpty()) { return; } Document doc = null; if (input.getSubNode() != null) { doc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { doc = XMLUtils.getOwnerDocument(input.getNodeSet()); } XMLUtils.circumventBug2650(doc); } }
private Set<Node> getNodeSet(List<NodeFilter> nodeFilters) { if (xi.isNeedsToBeExpanded()) { XMLUtils.circumventBug2650 (XMLUtils.getOwnerDocument(xi.getSubNode())); } Set<Node> inputSet = new LinkedHashSet<Node>(); XMLUtils.getSet(xi.getSubNode(), inputSet, null, !xi.isExcludeComments()); Set<Node> nodeSet = new LinkedHashSet<Node>(); for (Node currentNode : inputSet) { Iterator<NodeFilter> it = nodeFilters.iterator(); boolean skipNode = false; while (it.hasNext() && !skipNode) { NodeFilter nf = it.next(); if (nf.isNodeInclude(currentNode) != 1) { skipNode = true; } } if (!skipNode) { nodeSet.add(currentNode); } } return nodeSet; } }
protected void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { if (!input.isNeedsToBeExpanded()) { return; } Document doc = null; if (input.getSubNode() != null) { doc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { doc = XMLUtils.getOwnerDocument(input.getNodeSet()); } XMLUtils.circumventBug2650(doc); }