Package org.exist.source

Examples of org.exist.source.StringSource


        } else {
            final String queryStr = expr.getStringValue();
            if("".equals(queryStr.trim())) {
              return new EmptySequence();
            }
            querySource = new StringSource(queryStr);
        }

        NodeValue contextInit = null;
        if(isCalledAs("eval-with-context")) {
            // set the context initialization param for later use
View Full Code Here


            query += "import module namespace " + xqwsNamespace.getLocalName() + "=\"" + xqwsNamespace.getNamespaceURI() + "\" at \"" + xqwsFileUri.toString() + "\";" + SEPERATOR;
            query += SEPERATOR;
            query += "()";
           
            //compile the query
            return compileXQuery(broker, new StringSource(query), new XmldbURI[]{xqwsCollectionUri}, xqwsCollectionUri, null, null);
        }
View Full Code Here

            }
        }

        final XmldbURI pathUri = XmldbURI.create(path);
        try {
            final Source source = new StringSource(query);
            final XQuery xquery = broker.getXQueryService();
            final XQueryPool pool = xquery.getXQueryPool();
            CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);

            XQueryContext context;
View Full Code Here

        final long contentLength = request.getContentLength();
        while ((len = r.read(buffer)) >= 0 && count < contentLength) {
          count += len;
          builder.append(buffer, 0, len);
        }
        compiledQuery = xquery.compile(context, new StringSource(builder.toString()));
     
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery.", ex);
      } catch (final IOException ex) {
        throw new EXistException(
View Full Code Here

                Source source;
                if (xpointer == null)
                    {source = new DBSource(serializer.broker, (BinaryDocument) doc, true);}
                else {
                    xpointer = checkNamespaces(xpointer);
                    source = new StringSource(xpointer);
                }
                final XQuery xquery = serializer.broker.getXQueryService();
                final XQueryPool pool = xquery.getXQueryPool();
                XQueryContext context;
                CompiledXQuery compiled = pool.borrowCompiledXQuery(serializer.broker, source);
View Full Code Here

      } catch(final Exception e) {
        LOG.error(e);
      }
    } else if(strQuery != null) {
      //try and get the XQuery from a string
      querySource = new StringSource(strQuery);
    }
 
    return querySource;
  }
View Full Code Here

                String query = "update insert <node id='id" + Integer.toHexString(i) + "'>" +
                        "<p>Some longer text <b>content</b> in this node. Some longer text <b>content</b> in this node. " +
                        "Some longer text <b>content</b> in this node. Some longer text <b>content</b> in this node.</p>" +
                        "</node> " +
                        "into //test[@id = 't1']";
                service.execute(new StringSource(query));
            }
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

           
            //execute an xquery
          XQuery service = broker.getXQueryService();
          assertNotNull(service);
         
          CompiledXQuery compiled = service.compile(service.newContext(AccessContext.TEST), new StringSource(xquery));
          assertNotNull(compiled);
         
          Sequence result = service.execute(compiled, null);
          assertNotNull(result);
        
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.