Examples of buildDocument()


Examples of client.net.sf.saxon.ce.Configuration.buildDocument()

                err.setXPathContext(c);
                err.setErrorCode("FODC0002");
                throw err;
            }

            DocumentInfo newdoc = config.buildDocument(documentKey.toString());
            controller.registerDocument(newdoc, documentKey);
            controller.addUnavailableOutputDestination(documentKey);
            return getFragment(newdoc, fragmentId, c);

        } catch (XPathException err) {
View Full Code Here

Examples of com.tridion.tcdl.DocumentBuilder.buildDocument()

    DocumentBuilder documentBuilder = getDocumentBuilder();
    OutputDocument output = new OutputDocument();
    TagDispatcher dispatcher = new TagDispatcher(context, output, registry);
    TCDLParser parser = new TCDLParser(registry.getNamespaceList(), null);
    parser.parse(dispatcher, originalBody);
    documentBuilder.buildDocument(context, output, writer);
    return writer.toString();
  }

  /**
   * Evaluate an expresison if it's in a ${expression} notation. Otherwiese, return the original expression.
View Full Code Here

Examples of net.sf.clairv.index.builder.DocumentBuilder.buildDocument()

      try {
        FileInputStream fis = new FileInputStream(file);
        log.debug("Building document from file: "
            + file.getAbsolutePath());
        Document doc = docFactory.createDocument();
        builder.buildDocument(fis, doc);
        return doc;
      } catch (FileNotFoundException e) {
        log.error("File in use or not found");
        return null;
      } catch (DocumentHandlerException e) {
View Full Code Here

Examples of net.sf.saxon.Configuration.buildDocument()

                if (source == null) {
                    // indicate it was not possible to convert to a Source type
                    throw new NoTypeConversionAvailableException(body, Source.class);
                }

                DocumentInfo doc = config.buildDocument(source);
                dynamicQueryContext.setContextItem(doc);
            } finally {
                // can deal if is is null
                IOHelper.close(is);
            }
View Full Code Here

Examples of net.sf.saxon.Configuration.buildDocument()

                if (source == null) {
                    // indicate it was not possible to convert to a Source type
                    throw new NoTypeConversionAvailableException(body, Source.class);
                }

                DocumentInfo doc = config.buildDocument(source);
                dynamicQueryContext.setContextItem(doc);
            } finally {
                // can deal if is is null
                IOHelper.close(is);
            }
View Full Code Here

Examples of net.sf.saxon.query.QueryProcessor.buildDocument()

            StaticQueryContext staticQueryContext = new StaticQueryContext();
            QueryProcessor qp = new QueryProcessor(configuration, staticQueryContext);
            XQueryExpression xQueryExpression = qp.compileQuery(query);
            //if SAXON worked with JDOM directly we could replace the next with:
            ///DocumentInfo saxonDocInfo = qp.buildDocument(new DocumentWrapper(_parentDecomposition.getInternalDataDocument(), null));
            DocumentInfo saxonDocInfo = qp.buildDocument(new StreamSource(
                    new StringReader(outputter.outputString(document))));
            DynamicQueryContext dynamicQueryContext = new DynamicQueryContext();
            dynamicQueryContext.setContextNode(saxonDocInfo);
            resultObj = xQueryExpression.evaluateSingle(dynamicQueryContext);
            NodeInfo nodeInfo = (NodeInfo) resultObj;
View Full Code Here

Examples of net.sf.saxon.query.QueryProcessor.buildDocument()

            StaticQueryContext staticQueryContext = new StaticQueryContext();
            QueryProcessor qp = new QueryProcessor(configuration, staticQueryContext);
            XQueryExpression xQueryExpression = qp.compileQuery(query);
            //if SAXON worked with JDOM directly (like it claims to) we could replace the next with:
            ///DocumentInfo saxonDocInfo = qp.buildDocument(new DocumentWrapper(_parentDecomposition.getInternalDataDocument(), null));
            DocumentInfo saxonDocInfo = qp.buildDocument(new StreamSource(
                    new StringReader(outputter.outputString(element))));
            DynamicQueryContext dynamicQueryContext = new DynamicQueryContext();
            dynamicQueryContext.setContextNode(saxonDocInfo);
            List nodeList = xQueryExpression.evaluate(dynamicQueryContext);
            //my code to parse SAXON resulting XML tree and produce a string
View Full Code Here

Examples of net.sf.saxon.query.QueryProcessor.buildDocument()

        net.sf.saxon.query.StaticQueryContext context = new net.sf.saxon.query.StaticQueryContext();
        QueryProcessor qp = new QueryProcessor(config, context);
        try {
            XQueryExpression exp = qp.compileQuery("generate-id(/bye_mum/hi_there)");

            DocumentInfo doc = qp.buildDocument(new StreamSource(new StringReader(
                    "<bye_mum inf='h'><hi_there/></bye_mum>")));
            DynamicQueryContext dynamicQueryContext = new DynamicQueryContext();
            dynamicQueryContext.setContextNode(doc);
            Object o = exp.evaluateSingle(dynamicQueryContext);
System.out.println("o = " + o);
View Full Code Here

Examples of net.sf.saxon.query.StaticQueryContext.buildDocument()

              domDoc = domBuilder.parse(file);
            }
           
            NodeInfo saxonDoc = null;
            if (mode.equals("saxon")) {
              saxonDoc = context.buildDocument(new StreamSource(new ByteArrayInputStream(fileData)));
            }
   
            if (mode.startsWith("fi")) {
              if (mode.indexOf("stax") >= 0) {
//                data = serializeWithStax(doc, staxOutputFactory);
View Full Code Here

Examples of net.sf.saxon.query.StaticQueryContext.buildDocument()

                      doc2 = builder.build(new ByteArrayInputStream(fileData), baseURI);
                    } else {
                      doc2 = builder.build(new ByteArrayInputStream(data), baseURI);
                    }
                  } else if (mode.equals("saxon")) { // just for deser comparison
                    context.buildDocument(new StreamSource(new ByteArrayInputStream(fileData)));
                  } else if (mode.equals("dom")) {
                    domDoc = domBuilder.parse(new ByteArrayInputStream(fileData));
  //                  System.err.println(domDoc.getClass().getName());
                  } else if (mode.startsWith("fi") && mode.indexOf("stax") >=0 ) {
                    fistaxMethod.invoke(fistaxReader, new Object[] {new ByteArrayInputStream(data)});
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.