Package org.pdf4j.saxon

Examples of org.pdf4j.saxon.Configuration


     */

    public void setPipelineConfiguration(PipelineConfiguration pipe) {
        this.pipe = pipe;
        pipe.setLocationProvider(localLocator);
        Configuration config = pipe.getConfiguration();
        pool = config.getNamePool();
        ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE;
        retainDTDAttributeTypes = config.isRetainDTDAttributeTypes();
        suppressDTDAttributeDefaults = !pipe.isExpandAttributeDefaults();
        Boolean b = (Boolean)config.getConfigurationProperty(FeatureKeys.USE_PI_DISABLE_OUTPUT_ESCAPING);
        allowDisableOutputEscaping = b.booleanValue();
    }
View Full Code Here


     * @return the NodeInfo of the start node in the resulting document object.
     */

    public static NodeInfo build(Source source, Stripper stripper, PipelineConfiguration pipe)
    throws XPathException {
        Configuration config = pipe.getConfiguration();
        if (source == null) {
            throw new NullPointerException("Source supplied to builder cannot be null");
        }

        NodeInfo start;
        if (source instanceof DOMSource || source instanceof NodeInfo) {
            start = config.unravel(source);
            if (stripper != null) {
                DocumentInfo docInfo = start.getDocumentRoot();
                StrippedDocument strippedDoc = new StrippedDocument(docInfo, stripper);
                start = strippedDoc.wrap(start);
            }

        } else {
            // we have a SAXSource or StreamSource
            Builder b;
            if (config.getTreeModel() == Builder.TINY_TREE) {
                b = new TinyBuilder();
            } else {
                b = new TreeBuilder();
            }
            b.setPipelineConfiguration(pipe);
            if (config.isLineNumbering() ||
                    (source instanceof AugmentedSource && ((AugmentedSource)source).isLineNumbering())) {
                b.setLineNumbering(true);
            }
            Receiver receiver = b;
            if (stripper != null) {
View Full Code Here

                uri = getDefaultElementNamespace();
            } else {
                uri = getURIForPrefix(parts[0]);
            }
            if (nodeFactory == null) {
                Configuration config = getConfiguration();
                nodeFactory = new StyleNodeFactory(config, config.getErrorListener());
            }
            return nodeFactory.isElementAvailable(uri, parts[1]);
        } catch (QNameException e) {
            XPathException err = new XPathException("Invalid element name. " + e.getMessage());
            err.setErrorCode("XTDE1440");
View Full Code Here

    public Document parse(InputSource in) throws SAXException {
        try {
            Builder builder = new TinyBuilder();
            if (config == null) {
                config = new Configuration();
            }
            PipelineConfiguration pipe = config.makePipelineConfiguration();
            builder.setPipelineConfiguration(pipe);
            SAXSource source = new SAXSource(in);
            if (entityResolver != null) {
View Full Code Here

                }
            };
        } else if (NodeList.class.isAssignableFrom(targetClass)) {
            return new JPConverter() {
                public ValueRepresentation convert(Object obj, XPathContext context) throws XPathException {
                    Configuration config = context.getConfiguration();
                    NodeList list = ((NodeList)obj);
                    final int len = list.getLength();
                    NodeInfo[] nodes = new NodeInfo[len];
                    for (int i=0; i<len; i++) {
                        nodes[i] = wrapOrUnwrapNode(list.item(i), config);
View Full Code Here

    public TypeInfo getSchemaTypeInfo() {
        int annotation = node.getTypeAnnotation();
        if (annotation == -1) {
            return null;
        }
        final Configuration config = node.getConfiguration();
        return new TypeInfoImpl(config, config.getSchemaType(annotation));
    }
View Full Code Here

     * Create link to the owning PreparedStylesheet object
     * @param sheet the PreparedStylesheet
     */

    public void setPreparedStylesheet(PreparedStylesheet sheet) {
        Configuration config = sheet.getConfiguration();
        stylesheet = sheet;
        //targetNamePool = sheet.getTargetNamePool();
        exec = new Executable(config);
        exec.setConfiguration(config);
        exec.setRuleManager(new RuleManager());
        exec.setLocationMap(locationMap);
        exec.setHostLanguage(Configuration.XSLT);

        functionLibrary = new FunctionLibraryList();
        functionLibrary.addFunctionLibrary(
                SystemFunctionLibrary.getSystemFunctionLibrary(SystemFunctionLibrary.FULL_XSLT));
        functionLibrary.addFunctionLibrary(new StylesheetFunctionLibrary(this, true));
        functionLibrary.addFunctionLibrary(config.getVendorFunctionLibrary());
        functionLibrary.addFunctionLibrary(new ConstructorFunctionLibrary(config));
        queryFunctions = new XQueryFunctionLibrary(config);
        functionLibrary.addFunctionLibrary(queryFunctions);
        if (config.isAllowExternalFunctions()) {
            javaFunctions = config.getExtensionBinder("java");
            Configuration.getPlatform().addFunctionLibraries(functionLibrary, config, Configuration.XSLT);
        }
        functionLibrary.addFunctionLibrary(new StylesheetFunctionLibrary(this, false));

    }
View Full Code Here

                    return t.getCollator();
                }
            }
        }

        Configuration config = getConfiguration();
        return config.getCollationURIResolver().resolve(name, getBaseURI(), config);
    }
View Full Code Here

    public void setAttribute(String name, Object value) {
        if (name.equals(FeatureKeys.CONFIGURATION)) {
            config = (Configuration)value;
        } else {
            if (config == null) {
                config = new Configuration();
            }
            config.setConfigurationProperty(name, value);
        }
    }
View Full Code Here

                    exec.getKeyManager().preRegisterKeyDefinition(keyName);
                }
            }
        }
        // Now seal all the schemas that have been imported to guarantee consistency with instance documents
        Configuration config = getConfiguration();
        Iterator iter = schemaIndex.iterator();
        while (iter.hasNext()) {
            String ns = (String)iter.next();
            config.sealNamespace(ns);
        }


    }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.Configuration

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.