Package com.volantis.xml.namespace

Examples of com.volantis.xml.namespace.ImmutableExpandedName


        XMLPipeline pipeline = dynamicProcess.getPipeline();
        // add the process to the head of the pipeline       
        pipeline.addHeadProcess(new XMLProcessTestable());
       
        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");

        try {
            // call end element on the rule
            rule.endElement(dynamicProcess, eName, new XMLProcessTestable());
View Full Code Here


                    MCSI_URI, new MCSIContentHandlerFactory());

            // Initialise MCSI expression facilities
            ExpressionSupport.registerExternalNameSpacePrefix("mcsi", MCSI_URI);
            ExpressionSupport.registerExternalFunction(
                    new ImmutableExpandedName(MCSI_URI, "policy"),
                    new PolicyFunction());
        }
    }
View Full Code Here

    public void testGetUsedNamespaces() throws Exception {
        NamespacePrefixTracker namespacePrefixTracker =
            new DefaultNamespacePrefixTracker();
        JXPathFunctions functions =
            new JXPathFunctions(namespacePrefixTracker);
        ImmutableExpandedName nameA =
            new ImmutableExpandedName("http://spaceA",
                                      "a");
        ImmutableExpandedName nameB = new ImmutableExpandedName("", "b");
        ImmutableExpandedName nameC =
            new ImmutableExpandedName("http://spaceC",
                                      "c");
        ImmutableExpandedName nameC2 =
            new ImmutableExpandedName("http://spaceC",
                                      "c2");
        Function a = new TestFunction();
        Function b = new TestFunction();
        Function c = new TestFunction();
        Set namespaceURLs;
        Set expectedURLs = new HashSet();

        functions.addFunction(nameA, a);
        functions.addFunction(nameB, b);
        functions.addFunction(nameC, c);
        functions.addFunction(nameC2, c);

        expectedURLs.add(nameA.getNamespaceURI());
        expectedURLs.add(nameB.getNamespaceURI());
        expectedURLs.add(nameC.getNamespaceURI());
        expectedURLs.add(nameC2.getNamespaceURI());

        namespaceURLs = functions.getUsedNamespaces();

        assertEquals("number of used namespaces not as",
                     3,
View Full Code Here

    public void testGetFunction() throws Exception {
        NamespacePrefixTracker namespacePrefixTracker =
            new DefaultNamespacePrefixTracker();
        JXPathFunctions functions =
            new JXPathFunctions(namespacePrefixTracker);
        ImmutableExpandedName nameA =
            new ImmutableExpandedName("http://spaceA",
                                      "a");
        ImmutableExpandedName nameB = new ImmutableExpandedName("", "b");
        ImmutableExpandedName nameC =
            new ImmutableExpandedName("http://spaceC",
                                      "c");
        Function a = new TestFunction();
        Function b = new TestFunction();

        functions.addFunction(nameA, a);
        functions.addFunction(nameB, b);

        // Add the non-default prefixes
        namespacePrefixTracker.startPrefixMapping("spaceA",
                                                  nameA.getNamespaceURI());
        namespacePrefixTracker.startPrefixMapping("spaceC",
                                                  nameC.getNamespaceURI());
       
        assertSame("function A",
                   a,
                   functions.getFunction("spaceA",
                                         nameA.getLocalName(),
                                         null));
        assertSame("function B",
                   b,
                   functions.getFunction("",
                                         nameB.getLocalName(),
                                         null));
        assertNull("function C",
                   functions.getFunction("spaceC",
                                         nameC.getLocalName(),
                                         null));
    }
View Full Code Here

        NamespacePrefixTracker namespacePrefixTracker =
            new DefaultNamespacePrefixTracker();
        JXPathFunctions functions =
            new JXPathFunctions(namespacePrefixTracker);

        ImmutableExpandedName eName = new ImmutableExpandedName("", "foo");

        // register the function
        functions.addFunction(eName, function);

        // retrieve the function
View Full Code Here

    public void testAddFunction() throws Exception {
        NamespacePrefixTracker namespacePrefixTracker =
            new DefaultNamespacePrefixTracker();
        JXPathFunctions functions =
            new JXPathFunctions(namespacePrefixTracker);
        ImmutableExpandedName nameA =
            new ImmutableExpandedName("http://spaceA",
                                      "a");
        ImmutableExpandedName nameB = new ImmutableExpandedName("", "b");
        ImmutableExpandedName nameC =
            new ImmutableExpandedName("http://spaceC",
                                      "c");
        ImmutableExpandedName nameA2 =
            new ImmutableExpandedName("http://spaceA",
                                      "a");
        Function a = new TestFunction();
        Function b = new TestFunction();
        Function c = new TestFunction();
View Full Code Here

    // Javadoc inherited.
    public void registerFunctions(ExpressionContext context) {
        // Register the functions.
        for (Iterator i = functions.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            ImmutableExpandedName name = (ImmutableExpandedName) entry.getKey();
            Function function = (Function) entry.getValue();
            context.registerFunction(name, function);
        }

        // Register the default prefixes.
View Full Code Here

                startPrefixMapping("layout",
                                   LAYOUT_URI);


        expressionContext.registerFunction(
                new ImmutableExpandedName("test",
                        "test"),
                createTestableFunction());
    }
View Full Code Here

        Namespace integrationNamespace = Namespace.literal("integration");

        // register this function with the expression context
        context.registerFunction(
                new ImmutableExpandedName(
                        integrationNamespace.getURI(),
                        "emptySequence"),
                emptySequenceFn);

        // ensure the prefix tracker is aware of this namespace
View Full Code Here

                startPrefixMapping("service",
                                   SERVICE_URI);


        expressionContext.registerFunction(
                new ImmutableExpandedName(getURI(),
                                          getFunctionName()),
                createTestableFunction(expressionFactory));

        accessorMock = new DevicePolicyValueAccessorMock(
                "accessorMock", expectations);
View Full Code Here

TOP

Related Classes of com.volantis.xml.namespace.ImmutableExpandedName

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.