Package net.sf.saxon.xpath

Examples of net.sf.saxon.xpath.XPathFactoryImpl


public class XsdTypesTest extends TestCase {
    private static Log __log = LogFactory.getLog(XsdTypesTest.class);
   
    public void testDateTime() throws Exception {
        XPathFactoryImpl xpf = new XPathFactoryImpl();
        JaxpVariableResolver jvr = new JaxpVariableResolver(null, null, xpf.getConfiguration());
        Object o = jvr.getSimpleContent(DOMUtils.stringToDOM("<temporary-simple-type-wrapper>2010-01-25T15:38:54.82Z</temporary-simple-type-wrapper>"), QName.valueOf("{http://www.w3.org/2001/XMLSchema}dateTime"));
        __log.debug(o);
        assertTrue(o.toString().contains("2010-01-25T15:38:54.82Z"));
    }
View Full Code Here


        __log.debug(o);
        assertTrue(o.toString().contains("2010-01-25T15:38:54.82Z"));
    }

    public void testEmptyDateTime() throws Exception {
        XPathFactoryImpl xpf = new XPathFactoryImpl();
        JaxpVariableResolver jvr = new JaxpVariableResolver(null, null, xpf.getConfiguration());
        Object o = jvr.getSimpleContent(DOMUtils.stringToDOM("<temporary-simple-type-wrapper></temporary-simple-type-wrapper>"), QName.valueOf("{http://www.w3.org/2001/XMLSchema}dateTime"));
        __log.debug(o);
        assertTrue(o.toString().equals(""));
    }
View Full Code Here

        }

        out.xpath = xpathStr;
        try {
            __log.debug("Compiling expression " + xpathStr);
            XPathFactory xpf = new XPathFactoryImpl();
            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(
                    _compilerContext, out, source.getNamespaceContext(),
                    _bpelNS);
            JaxpVariableResolver varResolver = new JaxpVariableResolver(
                    _compilerContext, out);
            XPath xpe = xpf.newXPath();
            xpe.setXPathFunctionResolver(funcResolver);
            xpe.setXPathVariableResolver(varResolver);
            xpe.setNamespaceContext(source.getNamespaceContext());
            XPathExpression expr = xpe.compile(xpathStr);
            // evaluate the expression so as to initialize the variables
View Full Code Here

        }

        out.xpath = xpathStr;
        try {
            __log.debug("Compiling expression " + xpathStr);
            XPathFactory xpf = new XPathFactoryImpl();
            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(
                    _compilerContext, out, source.getNamespaceContext(), _bpelNS);
            JaxpVariableResolver varResolver = new JaxpVariableResolver(_compilerContext, out);
            XPath xpe = xpf.newXPath();
            xpe.setXPathFunctionResolver(funcResolver);
            xpe.setXPathVariableResolver(varResolver);
            xpe.setNamespaceContext(source.getNamespaceContext());
            XPathExpression expr = xpe.compile(xpathStr);
            // evaluate the expression so as to initialize the variables
View Full Code Here

    }

    private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type) throws FaultException, EvaluationException {
        try {
            OXPath20ExpressionBPEL20 oxpath20 = ((OXPath20ExpressionBPEL20) cexp);
            XPathFactory xpf = new XPathFactoryImpl();

            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(
                    ctx, oxpath20);
            JaxpVariableResolver varResolver = new JaxpVariableResolver(ctx, oxpath20, ((XPathFactoryImpl) xpf).getConfiguration());
            xpf.setXPathFunctionResolver(funcResolver);
            xpf.setXPathVariableResolver(varResolver);           
            XPath xpe = xpf.newXPath();
            xpe.setNamespaceContext(oxpath20.namespaceCtx);
            String xpath = ((OXPath10Expression)cexp).xpath;
            XPathExpression expr = xpe.compile(xpath);
            Node contextNode = ctx.getRootNode() == null ? DOMUtils.newDocument() : ctx.getRootNode();
            // Create step nodes in XPath in case it is incompletely instantiated
View Full Code Here

TOP

Related Classes of net.sf.saxon.xpath.XPathFactoryImpl

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.