Examples of NodeFilter


Examples of org.openbel.framework.ws.model.NodeFilter

        if (values.isEmpty()) {
            throw new RequestException("Values are missing");
        }

        // read optional filter
        final NodeFilter nf = req.getNodeFilter();

        // convert namespace/values to NamespaceValue objects for delegation
        List<NamespaceValue> nvs = new ArrayList<NamespaceValue>(values.size());
        for (String s : values) {
            NamespaceValue nv = OBJECT_FACTORY.createNamespaceValue();
View Full Code Here

Examples of org.w3c.dom.traversal.NodeFilter

   * Parses pipelined data out of a Document.
   */
  Map<PipelinedData, Node> parsePipelinedData(Gadget gadget, Document doc) {
    NodeIterator nodeIterator = ((DocumentTraversal) doc)
        .createNodeIterator(doc, NodeFilter.SHOW_ELEMENT,
            new NodeFilter() {
              public short acceptNode(Node n) {
                if ("script".equalsIgnoreCase(n.getNodeName()) &&
                    "text/os-data".equals(((Element) n).getAttribute("type"))) {
                  return NodeFilter.FILTER_ACCEPT;
                }
View Full Code Here

Examples of org.w3c.dom.traversal.NodeFilter

  }

  private List<Element> getScripts(final String type) {
    NodeIterator nodeIterator = ((DocumentTraversal) document)
    .createNodeIterator(document, NodeFilter.SHOW_ELEMENT,
        new NodeFilter() {
          public short acceptNode(Node n) {
            if ("script".equalsIgnoreCase(n.getNodeName()) &&
                type.equals(((Element) n).getAttribute("type"))) {
              return NodeFilter.FILTER_ACCEPT;
            }
View Full Code Here

Examples of org.w3c.dom.traversal.NodeFilter

        assertEquals(NodeFilter.SHOW_COMMENT, tw.getWhatToShow());
        assertEquals(null, tw.nextNode());
    }

    public void testFilter() throws Exception {
        NodeFilter nf = new NodeFilter() {
            public short acceptNode(Node node) {
                if ("b".equals(node.getNodeName()) || "f".equals(node.getNodeName())) {
                    return NodeFilter.FILTER_ACCEPT;
                }
                return NodeFilter.FILTER_SKIP;
View Full Code Here

Examples of org.w3c.dom.traversal.NodeFilter

    public final NodeList getElementsByTagNameNS(final String namespaceURI, final String localName) {
        checkLoaded();
        NodeListImpl list = new NodeListImpl(this);

        NodeFilter filter = new NodeFilter() {
            public short acceptNode(Node node) {
                if (node.getLocalName().equals(localName) && node.getNamespaceURI().equals(namespaceURI)) {
                    return NodeFilter.FILTER_ACCEPT;
                } else {
                    return NodeFilter.FILTER_SKIP;
View Full Code Here

Examples of org.w3c.dom.traversal.NodeFilter

            }
        }

        // TreeWalker to walk DOM tree starting with the scopeNode. Nodes maybe visited multiple times.
        TreeWalker treeWalker = ((DocumentTraversal) scopeNode.getOwnerDocument())
            .createTreeWalker(scopeNode, NodeFilter.SHOW_ELEMENT, new NodeFilter() {
            @Override
            public short acceptNode(Node node) {
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    NamedNodeMap attributes = node.getAttributes();
                    if (attributes.getNamedItem(ITEMPROP_ATTRIBUTE) != null && !scopeNode.equals(node)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.