Package net.sf.saxon.om

Examples of net.sf.saxon.om.DocumentInfo


        if (!(arg2 instanceof DocumentInfo)) {
            dynamicError("In the idref() function," +
                            " the context node must be in a tree whose root is a document node", context);
            return null;
        }
        DocumentInfo doc = (DocumentInfo)arg2;

        int fprint = StandardNames.XS_IDREFS;

        // If the argument is a singleton, we evaluate the function
        // directly; otherwise we recurse to evaluate it once for each Item
View Full Code Here


        Object parameter = argument;
        if (argument instanceof Document) {
            try {
                Document doc = (Document)argument;
                Node valueNode = doc.getFirstChild();
                DocumentInfo docInfo = null;
                if (valueNode instanceof Element && valueNode.getNodeName().equals("value")) {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    StreamResult sr = new StreamResult(baos);
                    try {
                        Node element = null;
View Full Code Here

        } else {
            Source source = in.getBody(Source.class);
            if (source == null) {
                source = converter.toDOMSource(converter.createDocument());
            }
            DocumentInfo doc = getStaticQueryContext().buildDocument(source);
            dynamicQueryContext.setContextItem(doc);
        }
       
        configureQuery(dynamicQueryContext, exchange);
        // call the reset if the in message body is StreamCache
View Full Code Here

        TransformerFactory tfactory = TransformerFactory.newInstance();
        Templates templates = tfactory.newTemplates(new StreamSource(xslID));
        Transformer transformer = templates.newTransformer();
        XPathEvaluator xpath = new XPathEvaluator();
        DocumentInfo doc = (DocumentInfo)xpath.setSource(new SAXSource(new InputSource(sourceID)));
        transformer.transform(doc, new StreamResult(System.out));
    }
View Full Code Here

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

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

        configuration = new Configuration();
      }
      Document doc = (Document)source;
      Document cloneDoc = (Document)doc.cloneNode(false);
      SaxonDataBindingHelper.setNamespacesAndPrefixesReq(doc, cloneDoc, cloneDoc, "", null);
      DocumentInfo docInfo = null;
      try {
        docInfo = configuration.buildDocument(new DOMSource(cloneDoc));
      } catch (XPathException e) {
        throw new TransformationException(e);
      }
View Full Code Here

        if(valueNode instanceof Element && valueNode.getNodeName().equals("value")) {
          SaxonDataBindingHelper.setNamespacesAndPrefixesReq(valueNode, cloneDoc, cloneDoc, "", null);
        } else {
          SaxonDataBindingHelper.setNamespacesAndPrefixesReq(doc, cloneDoc, cloneDoc, "", null);
        }
        DocumentInfo docInfo = configuration.buildDocument(new DOMSource(cloneDoc));
        parameter = docInfo;
      } catch (XPathException e) {
        e.printStackTrace();
        return parameter;
      }
View Full Code Here

                if (source == null) {
                    // indicate it was not possible to convert to a Source type
                    throw new NoTypeConversionAvailableException(body, Source.class);
                }
            }
            DocumentInfo doc = getStaticQueryContext().buildDocument(source);
            dynamicQueryContext.setContextItem(doc);
        }
       
        configureQuery(dynamicQueryContext, exchange);
        // call the reset if the in message body is StreamCache
View Full Code Here

        } else {
            Source source = in.getBody(Source.class);
            if (source == null) {
                source = converter.toSource(converter.createDocument());
            }
            DocumentInfo doc = getStaticQueryContext().buildDocument(source);
            dynamicQueryContext.setContextItem(doc);
        }
       
        configureQuery(dynamicQueryContext, exchange);
        // call the reset if the in message body is StreamCache
View Full Code Here

                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

TOP

Related Classes of net.sf.saxon.om.DocumentInfo

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.