Package org.pdf4j.saxon

Examples of org.pdf4j.saxon.Configuration


     * @param context    The dynamic evaluation context
     * @return           The value of the variable
     */

    public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException {
        Configuration config = context.getConfiguration();
        Object value = resolver.resolveVariable((QName)name.makeQName(config));
        if (value == null) {
            return EmptySequence.getInstance();
        }
        JPConverter converter = JPConverter.allocate(value.getClass(), config);
View Full Code Here


     * @return  The value returned by the extension function
     */

    protected SequenceIterator call(ValueRepresentation[] argValues, XPathContext context) throws XPathException {
        List convertedArgs = new ArrayList(argValues.length);
        Configuration config = context.getConfiguration();
        for (int i=0; i<argValues.length; i++) {
            Value actual = Value.asValue(argValues[i]).reduce();
            PJConverter converter = PJConverter.allocate(
                    config, actual.getItemType(config.getTypeHierarchy()), actual.getCardinality(), Object.class);
            convertedArgs.add(converter.convert(actual, Object.class, context));
        }
        try {
            Object result = function.evaluate(convertedArgs);
            if (result == null) {
View Full Code Here

                        usesCurrent = true;
                        break;
                    }
                }
                if (usesCurrent) {
                    Configuration config = getConfiguration();

                    LetExpression let = new LetExpression();
                    let.setVariableQName(new StructuredQName("saxon", NamespaceConstant.SAXON, "current" + hashCode()));
                    let.setRequiredType(SequenceType.SINGLE_ITEM);
                    let.setSequence(new ContextItemExpression());
                    let.setAction(Literal.makeEmptySequence());
                    PromotionOffer offer = new PromotionOffer(config.getOptimizer());
                    offer.action = PromotionOffer.REPLACE_CURRENT;
                    offer.containingExpression = let;
                    ((LocationPathPattern)pattern).resolveCurrent(let, offer, true);
                    //allocateSlots(let); //redundant, done again later
                }
View Full Code Here

        return null;
    }

  public static void main(String[] args) throws Exception {

    Controller controller = new Controller(new Configuration());
    TinyBuilder tb = (TinyBuilder)controller.makeBuilder();
    tb.open();
    NamePool p = tb.getConfiguration().getNamePool();
    int code = p.allocate("a", "b", "c");
    tb.startElement(code, -1, -1, -1);
View Full Code Here

     * Default constructor. Creates an XPathEvaluator with a default configuration and name pool.
     * The default Configuration is not schema-aware.
     */

    public XPathEvaluator() {
        this(new Configuration());
    }
View Full Code Here

    public XPathEvaluator(Source source) throws org.pdf4j.saxon.trans.XPathException {
        if (source instanceof NodeInfo) {
            config = ((NodeInfo)source).getDocumentRoot().getConfiguration();
        } else {
            config = new Configuration();
        }
        staticContext = new JAXPXPathStaticContext(config);
        setSource(source);
    }
View Full Code Here

        Expression tc = super.typeCheck(visitor, contextItemType);
        if (tc != this) {
            return tc;
        }

        Configuration config = visitor.getConfiguration();
        TypeHierarchy th = config.getTypeHierarchy();
        int firstParam = 0;
        int firstArg = 0;
        if (theMethod instanceof Constructor) {
            if (theParameterTypes == null) {
                theParameterTypes = ((Constructor)theMethod).getParameterTypes();
View Full Code Here

    public Processor(boolean schemaAware) {
        if (schemaAware) {
            config = Configuration.makeSchemaAwareConfiguration(null, null);
            schemaManager = new SchemaManager(config);
        } else {
            config = new Configuration();
        }
    }
View Full Code Here

     * @param args not used
     * @throws Exception
     */

    public static void main(String[] args) throws Exception {
        Configuration config = new Configuration();
        DocumentInfo doc = config.buildDocument(new StreamSource(new File("c:/MyJava/samples/data/books.xml")));
        PipelineConfiguration pipe = config.makePipelineConfiguration();
        pipe.setHostLanguage(Configuration.XQUERY);
        EventIterator e = new Decomposer(new SingletonEventIterator(doc), pipe);
        SequenceIterator iter = new SequenceComposer(e, pipe);
        while (true) {
            NodeInfo item = (NodeInfo)iter.next();
View Full Code Here

     * @param args not used
     * @throws Exception
     */

    public static void main(String[] args) throws Exception {
        Configuration config = new Configuration();
        DocumentInfo doc = config.buildDocument(new StreamSource(new File("c:/MyJava/samples/data/books.xml")));
        PipelineConfiguration pipe = config.makePipelineConfiguration();
        pipe.setHostLanguage(Configuration.XQUERY);
        EventIterator e = new Decomposer(new SingletonEventIterator(doc), pipe);
        e = EventStackIterator.flatten(e);
        e = new PullEventTracer(e, config);
        while (true) {
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.