Package client.net.sf.saxon.ce.tree.linked

Examples of client.net.sf.saxon.ce.tree.linked.LinkedTreeBuilder


            throw err;
        }

        try {
            DocumentImpl oldRoot = (DocumentImpl)getDocumentRoot();
            LinkedTreeBuilder builder = new LinkedTreeBuilder();
            builder.setPipelineConfiguration(pss.getConfiguration().makePipelineConfiguration());
            builder.setNodeFactory(nodeFactory);
            builder.setSystemId(this.getSystemId());

            builder.open();
            builder.startDocument();

            int st = StandardNames.XSL_STYLESHEET;
            builder.startElement(st, 0);
            builder.namespace(new NamespaceBinding("xsl", NamespaceConstant.XSLT), 0);
            builder.attribute(pool.allocate("", "", "version"), version);
            builder.startContent();

            int te = StandardNames.XSL_TEMPLATE;
            builder.startElement(te, 0);
            builder.attribute(pool.allocate("", "", "match"), "/");
            builder.startContent();

            builder.graftElement(this);

            builder.endElement();
            builder.endElement();
            builder.endDocument();
            builder.close();

            DocumentImpl newRoot = (DocumentImpl)builder.getCurrentRoot();
            newRoot.graftLocationMap(oldRoot);
            return newRoot;
        } catch (XPathException err) {
            //TransformerConfigurationException e = new TransformerConfigurationException(err);
            err.setLocator(this);
View Full Code Here


    public DocumentImpl loadStylesheetModule(DocumentInfo rawDoc)
            throws XPathException {

        StyleNodeFactory nodeFactory = getStyleNodeFactory();

        LinkedTreeBuilder styleBuilder = new LinkedTreeBuilder();
        PipelineConfiguration pipe = getConfiguration().makePipelineConfiguration();
        styleBuilder.setPipelineConfiguration(pipe);
        styleBuilder.setSystemId(rawDoc.getSystemId());
        styleBuilder.setNodeFactory(nodeFactory);

        StartTagBuffer startTagBuffer = new StartTagBuffer();
        NamespaceReducer nsReducer = new NamespaceReducer();
        nsReducer.setUnderlyingReceiver(startTagBuffer);

        UseWhenFilter useWhenFilter = new UseWhenFilter(startTagBuffer, nsReducer);
        useWhenFilter.setUnderlyingReceiver(styleBuilder);

        startTagBuffer.setUnderlyingReceiver(useWhenFilter);

        StylesheetStripper styleStripper = new StylesheetStripper();
        styleStripper.setUnderlyingReceiver(nsReducer);

        CommentStripper commentStripper = new CommentStripper();
        commentStripper.setUnderlyingReceiver(styleStripper);
        commentStripper.setPipelineConfiguration(pipe);

        // build the stylesheet document
        commentStripper.open();
        rawDoc.copy(commentStripper, CopyOptions.ALL_NAMESPACES);
        commentStripper.close();

        DocumentImpl doc = (DocumentImpl)styleBuilder.getCurrentRoot();
        styleBuilder.reset();

        return doc;
    }
View Full Code Here

     * @return an instance of the Builder for the chosen tree model
     * @since 8.4
     */

    public Builder makeBuilder() {
        return new LinkedTreeBuilder();
    }
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.tree.linked.LinkedTreeBuilder

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.