Package org.exist.dom

Examples of org.exist.dom.NodeProxy


   
    ValueSequence returnSeq = new ValueSequence();

    try {
      for (DocumentImpl doc : MetaData.get().matchDocuments(args[0].getStringValue(), args[1].getStringValue())) {
        returnSeq.add(new NodeProxy(doc));
      }
    } catch (Exception e) {
      throw new XPathException(this, e);
    }
   
View Full Code Here


          }
  //        LOG.debug(current.debugContext());
          while (context != null) {
                      //TODO : Is this the context we want ? Not sure... would have prefered the LetExpr.
            if (context.getContextId() == whereExpr.getContextId()) {
              final NodeProxy contextNode = context.getNode();                   
              if(contextIsVirtual || contextSet.contains(contextNode)) {
                              contextNode.addMatches(current);
                result.add(contextNode, sizeHint);
              }
            }
                      context = context.getNextDirect();
          }
View Full Code Here

        return Sequence.EMPTY_SEQUENCE;

    ValueSequence returnSeq = new ValueSequence();
   
    if (meta.getValue() instanceof DocumentImpl) {
      returnSeq.add( new NodeProxy( (DocumentImpl) meta.getValue() ) );
   
    } else {
      returnSeq.add(new StringValue(meta.getValue().toString()));
    }
View Full Code Here

        this.context = contextSet;
        this.contextId = contextId;
    }

    public NodeProxy match(DocumentImpl doc, NodeId nodeId) {
        final NodeProxy contextNode = context.parentWithChild(doc, nodeId, true, false);
        if (contextNode == null)
           {return null;}
        final NodeProxy p = new NodeProxy(doc, nodeId);
        if (Expression.NO_CONTEXT_ID != contextId) {
            p.deepCopyContext(contextNode, contextId);
        } else
            {p.copyContext(contextNode);}
        return p;
    }
View Full Code Here

  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
      DocumentImpl doc = MetaData.get().getDocument(args[0].getStringValue());
      if (doc == null) return Sequence.EMPTY_SEQUENCE;
     
      return new NodeProxy(doc);
    } catch (Exception e) {
      throw new XPathException(this, e);
    }
  }
View Full Code Here

    if (n != null && n instanceof org.exist.memtree.NodeImpl) {
     
      final XmldbURI[] docs = new XmldbURI[] { XmldbURI.create(res.getParentCollection().getName()) };
      return doQuery(query, docs, (org.exist.memtree.NodeImpl)n, sortBy);
    }
    final NodeProxy node = ((LocalXMLResource) res).getNode();
    if (node == null) {
      // resource is a document
            //TODO : use dedicated function in XmldbURI
      final XmldbURI[] docs = new XmldbURI[] { XmldbURI.create(res.getParentCollection().getName()).append(res.getDocumentId()) };
      return doQuery(query, docs, null, sortBy);
    } else {
      final NodeSet set = new ExtArrayNodeSet(1);
      set.add(node);
      final XmldbURI[] docs = new XmldbURI[] { node.getDocument().getURI() };
      return doQuery(query, docs, set, sortBy);
    }
  }
View Full Code Here

    return execute(null, null, expression, null);
  }
 
  public ResourceSet execute(XMLResource res, CompiledExpression expression)
      throws XMLDBException {
    final NodeProxy node = ((LocalXMLResource) res).getNode();
    if (node == null) {
      // resource is a document
      final XmldbURI[] docs = new XmldbURI[] { XmldbURI.create(res.getParentCollection().getName()).append(res.getDocumentId()) };
      return execute(docs, null, expression, null);
    } else {
      final NodeSet set = new ExtArrayNodeSet(1);
      set.add(node);
      final XmldbURI[] docs = new XmldbURI[] { node.getDocument().getURI() };
      return execute(docs, set, expression, null);
    }
  }
View Full Code Here

      // iterate through children
      for (int i = 0; i < children.getLength(); i++) {
        final StoredNode node = (StoredNode) children.item(i);
        final Iterator<StoredNode> domIter = broker.getNodeIterator(node);
        domIter.next();
        final NodeProxy p = new NodeProxy(node);
        serializeToReceiver(node, domIter, (DocumentImpl)node.getOwnerDocument(),
            true, p.getMatches(), new TreeSet<String>());
      }

      if (generateDocEvent) {receiver.endDocument();}

      if (LOG.isDebugEnabled())
View Full Code Here

TOP

Related Classes of org.exist.dom.NodeProxy

Copyright © 2018 www.massapicom. 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.