Package org.exist.source

Examples of org.exist.source.StringSource


//        querySource = SourceFactory.getSource(broker, null, scriptURI, false);
//      } catch(Exception e) {
//        //LOG.error(e);
//      }
    } else if(script != null && !script.isEmpty()) {
      return new StringSource(script);
    }
 
    return null;
  }
View Full Code Here


                    log( "XQuery file " + queryFile.getAbsolutePath(), Project.MSG_DEBUG );
                    source = new FileSource( queryFile, "UTF-8", true );

                } else {
                    log( "XQuery string: " + query, Project.MSG_DEBUG );
                    source = new StringSource( query );
                }

                results = service.execute( source );
                log( "Found " + results.getSize() + " results", Project.MSG_INFO );
View Full Code Here

   
  public static ResourceSet xquery(Collection collection, String xquery)
  throws XMLDBException
  {
    XQueryService service = getXQueryService(collection);
    Source source = new StringSource(xquery);
    return service.execute(source);
  }
View Full Code Here

                        "request attribute '" + ATTR_XQUERY_SOURCE + "': " + e.getMessage(), e);
                }
            else
                {s = sourceAttrib.toString();}
           
            source = new StringSource(s);
           
        } else if (urlAttrib != null) {
            DBBroker broker = null;
            try {
              broker = getPool().get(user);
View Full Code Here

  public void test(String script) {
        try {
            StringBuilder fails = new StringBuilder();
            StringBuilder results = new StringBuilder();
            XQueryService xqs = (XQueryService) rootCollection.getService("XQueryService", "1.0");
            Source query = new StringSource(script);

            ResourceSet result = xqs.execute(query);
            XMLResource resource = (XMLResource) result.getResource(0);
            results.append(resource.getContent()).append('\n');
            Element root = (Element) resource.getContentAsDOM();
View Full Code Here

    if (pattern.equals("/")) {
      content.add(new LocationStep(context, Constants.SELF_AXIS, new AnyNodeTest()));
      return;
    }
   
    Source source = new StringSource(pattern);
        Reader reader;
    try {
      reader = source.getReader();
    } catch (IOException e1) {
      return;//TODO: report error???
    }
   
      long start = System.currentTimeMillis();
View Full Code Here

                root = mkcol(root, baseURI, XmldbURI.ROOT_COLLECTION, path);
            } else
                root = DatabaseManager.getCollection(uri, user, password);

            XQueryService service = (XQueryService) root.getService("XQueryService", "1.0");
            Source source = new StringSource(XQUERY);
            service.declareVariable("collection", root.getName());
            service.declareVariable("uri", "");
            if (moduleURI != null) {
                service.declareVariable("uri", moduleURI);
                service.declareVariable("data", "");
View Full Code Here

   */
  protected NodeList select(DocumentSet docs)
    throws PermissionDeniedException, EXistException, XPathException {
    final XQuery xquery = broker.getXQueryService();
    final XQueryPool pool = xquery.getXQueryPool();
    final Source source = new StringSource(selectStmt);
    CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
    XQueryContext context;
    if(compiled == null)
        {context = xquery.newContext(getAccessContext());}
    else
View Full Code Here

  public long process(Txn transaction) throws PermissionDeniedException, LockException,
      EXistException, XPathException, TriggerException {
    LOG.debug("Processing xupdate:if ...");
    final XQuery xquery = broker.getXQueryService();
    final XQueryPool pool = xquery.getXQueryPool();
    final Source source = new StringSource(selectStmt);
    CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
    XQueryContext context;
    if(compiled == null)
        {context = xquery.newContext(getAccessContext());}
    else
View Full Code Here

    @Override
    public String printDiagnostics(String query, HashMap<String, Object> parameters) throws EXistException, PermissionDeniedException {
        DBBroker broker = null;
        try {
            broker = factory.getBrokerPool().get(user);
            final Source source = new StringSource(query);
            final XQuery xquery = broker.getXQueryService();
            final XQueryPool pool = xquery.getXQueryPool();
            CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
            if(compiled == null)
                {compiled = compile(broker, source, parameters);}
View Full Code Here

TOP

Related Classes of org.exist.source.StringSource

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.