Package com.volantis.mcs.xml.schema.validation

Examples of com.volantis.mcs.xml.schema.validation.DocumentValidator


        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);

        validator.open(elementType);
        assertTrue(validator.pcdata(false));
        assertTrue(validator.pcdata(false));
        assertTrue(validator.pcdata(false));
        validator.close(elementType);
    }
View Full Code Here


        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);

        validator.open(elementType);
        assertTrue(validator.pcdata(true));
        assertTrue(validator.pcdata(true));
        assertTrue(validator.pcdata(true));
        validator.close(elementType);
    }
View Full Code Here

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);

        validator.open(elementType);
        assertFalse(validator.pcdata(true));
        assertFalse(validator.pcdata(true));
        assertFalse(validator.pcdata(true));
        validator.close(elementType);
    }
View Full Code Here

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);

        validator.open(elementType);
        assertFalse(validator.pcdata(true));
        try {
            validator.pcdata(false);
        } catch (ValidationException e) {
            assertEquals("PCDATA not allowed", e.getMessage());
        }
        validator.close(elementType);
    }
View Full Code Here

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);


        validator.open(elementType);
        {
            // Content is not whitespace so must be valid and will be consumed.
            assertTrue(validator.pcdata(false));

            validator.open(elementType);
            {
                // Content is whitespace and is not valid and so won't be
                // consumed.
                assertFalse(validator.pcdata(true));
            }
            validator.close(elementType);
        }
        validator.close(elementType);
    }
View Full Code Here

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        DocumentValidator validator = new DocumentValidatorImpl(
                compiledSchemaMock);

        validator.open(elementType);
        {
            validator.open(elementType);
            {
                // Content is not whitespace so must be valid and will be
                // consumed.
                assertTrue(validator.pcdata(false));
            }
            validator.close(elementType);

            // Content is whitespace and is not valid and so won't be consumed.
            assertFalse(validator.pcdata(true));
        }
        validator.close(elementType);
    }
View Full Code Here

    }

    protected void runThroughValidator(List elements)
            throws ValidationException {
       
        DocumentValidator validator = xdimeContext.getDocumentValidator();
        Iterator i = elements.iterator();
        while(i.hasNext()) {
            ElementType element = (ElementType)i.next();
            validator.open(element);
            validator.close(element);  
        }           
    }
View Full Code Here

        // Normally the ElementOutputStateBuilder would be configured when
        // processing the element, but because this element isn't processed we
        // need to manually set the context and create the output state.
        elementImpl.getOutputState();

        DocumentValidator validator = xdimeContext.getDocumentValidator();
        validator.open(elementImpl.getElementType());
        xdimeContext.pushElement(element);
    }
View Full Code Here

        // Do the equivalent of #pushElement but without getting element
        // output state builder.
        XDIMEElementInternal elementImpl = objectMock;

        DocumentValidator validator = xdimeContext.getDocumentValidator();
        validator.open(elementImpl.getElementType());
        xdimeContext.pushElement(objectMock);

        startDocument();

        AttributesImpl attr = new AttributesImpl();
View Full Code Here

    }

    private void openElementForValidation(ElementType childType)
            throws Exception {

        DocumentValidator validator = xdimeContext.getDocumentValidator();
        validator.open(childType);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xml.schema.validation.DocumentValidator

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.