Package org.pdf4j.saxon

Examples of org.pdf4j.saxon.Configuration


    public Object getAttribute(String name) {
        if (name.equals(FeatureKeys.CONFIGURATION)) {
            return config;
        } else {
            if (config == null) {
                config = new Configuration();
            }
            return config.getConfigurationProperty(name);
        }
    }
View Full Code Here


                        underriding.addFunction(func.getCompiledFunction());
                    }
                }
            }

            Configuration config = getConfiguration();
            FunctionLibraryList libraryList = new FunctionLibraryList();
            libraryList.addFunctionLibrary(
                    SystemFunctionLibrary.getSystemFunctionLibrary(SystemFunctionLibrary.FULL_XSLT));
            libraryList.addFunctionLibrary(overriding);
            libraryList.addFunctionLibrary(config.getVendorFunctionLibrary());
            libraryList.addFunctionLibrary(new ConstructorFunctionLibrary(getConfiguration()));
            libraryList.addFunctionLibrary(queryFunctions);
            if (getConfiguration().isAllowExternalFunctions()) {
                //libraryList.addFunctionLibrary(javaFunctions);
                Configuration.getPlatform().addFunctionLibraries(libraryList, config, Configuration.XSLT);
View Full Code Here

        }

    }

    private void outputElement(Element element, NamedNodeMap atts) throws XPathException {
        final Configuration config = pipe.getConfiguration();
        String[] elparts2 = nsSupport.processName(element.getTagName(), elparts, false);
        if (elparts2==null) {
              throw new XPathException("Undeclared namespace in " + element.getTagName());
        }
        String uri = elparts2[0];
        String local = elparts2[1];
        String prefix = NameChecker.getPrefix(elparts2[2]);

        NamePool namePool = config.getNamePool();
        int nameCode = namePool.allocate(prefix, uri, local);

        receiver.startElement(nameCode, StandardNames.XS_UNTYPED, 0, 0);
        for (Iterator iter = nsDeclarations.keySet().iterator(); iter.hasNext();) {
            String nsprefix = (String)iter.next();
View Full Code Here

    public XPathFactoryImpl(Configuration config) {
        this.config = config;
    }

    protected Configuration makeConfiguration() {
        return new Configuration();
    }
View Full Code Here

        if (schemaAware) {
            // remove this line to compile the code for use under Saxon-B only
            config = Configuration.makeSchemaAwareConfiguration(null, null);
            config.displayLicenseMessage();
        } else {
            config = new Configuration();
        }

        config.setAllowExternalFunctions(allowExtensions);
        config.setExpandAttributeDefaults(expandAttributeDefaults);
        config.setLineNumbering(lineNumbering);
View Full Code Here

    private static Value convertFromDotNet(Object result, cli.System.Type returnType, XPathContext context)
    throws XPathException {

        // Offer the object to all the registered external object models

        Configuration config = context.getConfiguration();
        List externalObjectModels = config.getExternalObjectModels();
        for (int m=0; m<externalObjectModels.size(); m++) {
            ExternalObjectModel model = (ExternalObjectModel)externalObjectModels.get(m);
            if (model instanceof DotNetObjectModel) {
                Value val = ((DotNetObjectModel)model).convertObjectToXPathValue(result, config);
                if (val != null) {
View Full Code Here

            throw new SaxonApiException("Requested type is not atomic");
        }
        if (((AtomicType)it).isAbstract()) {
            throw new SaxonApiException("Requested type is an abstract type");
        }
        Configuration config = type.getProcessor().getUnderlyingConfiguration();
        ConversionResult result = new StringValue(lexicalForm).convert(
                (AtomicType)it, true, config.getConversionContext());
        try {
            setValue(result.asAtomic());
        } catch (ValidationException e) {
            throw new SaxonApiException(e);
        }
View Full Code Here

                    case StandardNames.XS_UNTYPED_ATOMIC:
                        return tree.getAtomizedValueOfUntypedNode(nextNodeNr);
                    case StandardNames.XS_STRING:
                        return new StringValue(TinyParentNodeImpl.getStringValue(tree, nextNodeNr));
                    default:
                        Configuration config = tree.getConfiguration();
                        SchemaType stype = config.getSchemaType(type);
                        if (stype instanceof AtomicType && !((AtomicType)stype).isNamespaceSensitive()) {
                            CharSequence value = TinyParentNodeImpl.getStringValue(tree, nextNodeNr);
                            return StringValue.convertStringToAtomicType(
                                    value, (AtomicType)stype, config.getNameChecker()
                            ).asAtomic();
                        } else {
                            // do it the slow way: create the node
                            return ((NodeInfo)current()).atomize();
                        }
View Full Code Here

     * @throws SaxonApiException if the type name is not known, or if the type identified by the
     * name is not an atomic type.
     */

    public ItemType getAtomicType(QName name) throws SaxonApiException {
        Configuration config = processor.getUnderlyingConfiguration();
        int fp = config.getNamePool().allocate("", name.getNamespaceURI(), name.getLocalName());
        SchemaType type = config.getSchemaType(fp);
        if (type == null || !type.isAtomicType()) {
            throw new SaxonApiException("Unknown atomic type " + name.getClarkName());
        }
        return new ItemType((AtomicType)type, processor);
    }
View Full Code Here

     * @throws SaxonApiException if the schema does not contain a global element declaration
     * for the given name
     */

    public ItemType getSchemaElementTest(QName name) throws SaxonApiException {
        Configuration config = processor.getUnderlyingConfiguration();
        int fingerprint = config.getNamePool().allocate("", name.getNamespaceURI(), name.getLocalName());
        SchemaDeclaration decl = config.getElementDeclaration(fingerprint);
        if (decl == null) {
            throw new SaxonApiException("No global declaration found for element " + name.getClarkName());
        }
        CombinedNodeTest combo = new CombinedNodeTest(
                new NameTest(Type.ELEMENT, fingerprint, config.getNamePool()),
                Token.INTERSECT,
                new ContentTypeTest(Type.ELEMENT, decl.getType(), config));
        combo.setGlobalComponentTest(true);
        return new ItemType(combo, processor);
    }
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.