Package net.sf.saxon.dom

Examples of net.sf.saxon.dom.DocumentWrapper


    public NodeInfo setSource(Source source) throws net.sf.saxon.trans.XPathException {
        if (source instanceof DOMSource) {
            Node node = ((DOMSource)source).getNode();
            String baseURI = source.getSystemId();
            DocumentWrapper documentWrapper = new DocumentWrapper(node.getOwnerDocument(), baseURI, config);
            NodeWrapper nodeWrapper = documentWrapper.wrap(node);
            if (stripSpace) {
                SpaceStrippedDocument sdoc = new SpaceStrippedDocument(documentWrapper, AllElementStripper.getInstance());
                return sdoc.wrap(nodeWrapper);
            } else {
                return nodeWrapper;
View Full Code Here


                    if (dsnode instanceof Document) {
                        dom = (Document)dsnode;
                    } else {
                        dom = dsnode.getOwnerDocument();
                    }
                    DocumentWrapper docWrapper = new DocumentWrapper(dom, source.getSystemId(), config);
                    start = docWrapper.wrap(dsnode);
                }
            } else {
                start = (NodeInfo)source;
            }
            if (stripper != null) {
View Full Code Here

                if (dsnode instanceof Document) {
                    dom = (Document)dsnode;
                } else {
                    dom = dsnode.getOwnerDocument();
                }
                DocumentWrapper docWrapper = new DocumentWrapper(dom, source.getSystemId(), getConfiguration());
                start = docWrapper.wrap(dsnode);
            }
        } else {
            start = (NodeInfo)source;
        }
        if (executable.stripsWhitespace() && !disableStripping) {
View Full Code Here

                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                factory.setNamespaceAware(true);
                DocumentBuilder builder = factory.newDocumentBuilder();
                org.w3c.dom.Document doc = builder.parse(ss.getInputSource());
                DocumentWrapper jdom = new DocumentWrapper(doc, ss.getSystemId(), getConfiguration());
                domSources.add(jdom);
            }
            return domSources;
        } catch (ParserConfigurationException e) {
            throw new DynamicError(e);
View Full Code Here

        Document doc = DOMUtils.newDocument();
        Text textNode = doc.createTextNode(data);
        inputs.add(textNode);
        inputs.add(Arrays.asList(textNode));

        DocumentWrapper dw = new DocumentWrapper(doc, "", new Configuration());
        NodeWrapper nw = dw.wrap(textNode);
        inputs.add(nw);

        for (int i = 0; i < inputs.size(); i++) {
            assertEquals(expectedResult, JaxpFunctionResolver.Helper.extractString(inputs.get(i)));
        }
View Full Code Here

        Document doc = DOMUtils.newDocument();
        Text textNode = doc.createTextNode(data);
        inputs.add(textNode);
        inputs.add(Arrays.asList(textNode));

        DocumentWrapper dw = new DocumentWrapper(doc, "", new Configuration());
        NodeWrapper nw = dw.wrap(textNode);
        inputs.add(nw);

        for (int i = 0; i < inputs.size(); i++) {
            assertEquals(expectedResult, JaxpFunctionResolver.Helper.extractString(inputs.get(i)));
        }
View Full Code Here

TOP

Related Classes of net.sf.saxon.dom.DocumentWrapper

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.