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

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


                    }
                }

                DocumentInfo rawDoc = getConfiguration().buildDocument(source);
                getConfiguration().getDocumentPool().add(rawDoc, key);
                DocumentImpl includedDoc = pss.loadStylesheetModule(rawDoc);

                // allow the included document to use "Literal Result Element as Stylesheet" syntax

                ElementImpl outermost = includedDoc.getDocumentElement();

                if (outermost instanceof LiteralResultElement) {
                    includedDoc = ((LiteralResultElement)outermost)
                            .makeStylesheet(getPreparedStylesheet());
                    outermost = includedDoc.getDocumentElement();
                }

                if (!(outermost instanceof XSLStylesheet)) {
                    compileError("Included document " + href + " is not a stylesheet", "XTSE0165");
                    return null;
View Full Code Here


            pss.reportError(err);
            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);
            throw err;
View Full Code Here

        // 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

     */

    protected void setStylesheetDocument(DocumentImpl doc)
            throws XPathException {

        DocumentImpl styleDoc = doc;

        // If top-level node is a literal result element, stitch it into a skeleton stylesheet

        StyleElement topnode = (StyleElement)styleDoc.getDocumentElement();
        if (topnode == null) {
          throw new XPathException("Failed to parse stylesheet");
        }
        if (topnode instanceof LiteralResultElement) {
            styleDoc = ((LiteralResultElement)topnode).makeStylesheet(this);
        }

        if (!(styleDoc.getDocumentElement() instanceof XSLStylesheet)) {
            throw new XPathException(
                    "Outermost element of stylesheet is not xsl:stylesheet or xsl:transform or literal result element");
        }

        XSLStylesheet top = (XSLStylesheet)styleDoc.getDocumentElement();
        if (compilerInfo.isVersionWarning() &&
                top.getEffectiveVersion().compareTo(DecimalValue.TWO) != 0) {

            getConfiguration().issueWarning("Running an XSLT " + top.getEffectiveVersion() + " stylesheet with an XSLT 2.0 processor");

View Full Code Here

TOP

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

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.