Package net.sf.saxon.om

Examples of net.sf.saxon.om.Item


        public ExtensionFunctionCall makeCallExpression() {
            return new ExtensionFunctionCall() {
                @Override
                public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
                    // get value of first arg passed to the function
                    Item arg1 = sequences[0].head();
                    String arg1Val = arg1.getStringValue();

                    // return a altered version of the first arg
                    return new StringValue("arg1[" + arg1Val + "]");
                }
            };
View Full Code Here


        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();
        Source source = null;
        try {
            Item item = in.getBody(Item.class);
            dynamicQueryContext.setContextItem(item);
        } catch (NoTypeConversionAvailableException e) {
            try {
                source = in.getBody(Source.class);
            } catch (NoTypeConversionAvailableException e2) {
View Full Code Here

        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();
        Source source = null;
        try {
            Item item = in.getBody(Item.class);
            dynamicQueryContext.setContextItem(item);
        } catch (NoTypeConversionAvailableException e) {
            try {
                source = in.getBody(Source.class);
            } catch (NoTypeConversionAvailableException e2) {
View Full Code Here

        try {
            iterator = exp.iterator(dynamicContext);
        } finally {
            SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = oldConfigValue;
        }
        Item item = iterator.next();
        if (item == null) {
            return null;
        }
        if (item instanceof NodeInfo) {
            return item;
View Full Code Here

        Configuration config = getConfiguration();
        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();

        Item item = in.getBody(Item.class);
        if (item != null) {
            dynamicQueryContext.setContextItem(item);
        } else {
            Object body = in.getBody();
View Full Code Here

        Configuration config = getConfiguration();
        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();

        Item item = in.getBody(Item.class);
        if (item != null) {
            dynamicQueryContext.setContextItem(item);
        } else {
            Object body = in.getBody();
View Full Code Here

    private Element createElement(NodeInfo nodeInfo) {
        Element el = new Element(nodeInfo.getLocalName());
        AxisIterator iter = nodeInfo.iterateAxis(Axis.CHILD, AnyNodeTest.getInstance());
        while (iter.hasNext()) {
            Item item = iter.next();
            switch (item.getItemType()) {
                case Type.ELEMENT:
                    el.addContent(createElement((NodeInfo) item));
                    break;
                default:
                    try {
                        el.setText(item.getStringValue());
                    } catch (XPathException e) {
                        e.printStackTrace();
                    }
            }
        }
        iter = nodeInfo.iterateAxis(Axis.ATTRIBUTE, AnyNodeTest.getInstance());
        while (iter.hasNext()) {
            Item item = iter.next();
            el.setAttribute(((NodeInfo) item).getLocalName(), ((NodeInfo) item).getStringValue());
        }
        return el;
    }
View Full Code Here

    protected DynamicQueryContext createDynamicContext(Exchange exchange) throws Exception {
        Configuration config = getConfiguration();
        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();
        Item item = in.getBody(Item.class);
        Source source = null;
        if (item != null) {
            dynamicQueryContext.setContextItem(item);
        } else {
            source = in.getBody(Source.class);
View Full Code Here

        try {
            iterator = exp.iterator(dynamicContext);
        } finally {
            SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = oldConfigValue;
        }
        Item item = iterator.next();
        if (item == null) {
            return null;
        }
        if (item instanceof NodeInfo) {
            return item;
View Full Code Here

        Configuration config = getConfiguration();
        DynamicQueryContext dynamicQueryContext = new DynamicQueryContext(config);

        Message in = exchange.getIn();

        Item item = in.getBody(Item.class);
        if (item != null) {
            dynamicQueryContext.setContextItem(item);
        } else {
            Source source = in.getBody(Source.class);
            if (source == null) {
View Full Code Here

TOP

Related Classes of net.sf.saxon.om.Item

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.