Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.validate()


    {
        XmlObject xdoc = XmlObject.Factory.parse("<test-no-type>something</test-no-type>");
        Assert.assertTrue("Untyped document should be invalid", !xdoc.validate());
       
        xdoc = XmlObject.Factory.parse("<x:blah xmlns:x=\"http://no-type.com/\"/>");
        Assert.assertTrue("Untyped document should be invalid", !xdoc.validate());
    }
   
    // bug 26790
    public static void testComplexSetter() throws XmlException
    {
View Full Code Here


        for ( ; ; )
        {
            XmlObject obj = c.getObject();

            if (obj != null)
                obj.validate();

            if (c.toNextToken().isNone())
                break;
        }
View Full Code Here

        for ( ; ; )
        {
            XmlObject obj = c.getObject();

            if (obj != null)
                obj.validate();

            if (c.toNextToken().isNone())
                break;
        }
    }
View Full Code Here

        XmlObject x =
            stl.parse(
                "<base><foo/></base>", null, null );

        Assert.assertTrue( x.validate() );

        XmlCursor c = x.newCursor();

        c.toFirstChild();
View Full Code Here

   
    public void v ( String xml ) throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( xml );
        Assert.assertTrue( x.schemaType() != XmlObject.type );
        Assert.assertTrue( x.validate() );
    }
   
    public void nv ( String xml ) throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( xml );
View Full Code Here

   
    public void nv ( String xml ) throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( xml );
        Assert.assertTrue( x.schemaType() != XmlObject.type );
        Assert.assertTrue( !x.validate() );
    }
   
    public void ___testDefault ( ) throws Exception
    {
        // Default
View Full Code Here

           
            List xel = new ArrayList();
           
            options.put( XmlOptions.ERROR_LISTENER, xel );
           
            boolean isValid = x.validate( options );
           
            if (!isValid)
            {
                System.err.println( "Invalid doc, expected a valid doc: " );
                System.err.println( "Instance(" + i + "): " );
View Full Code Here

                    c.toFirstChild();
                    x = c.getObject();
                    c.dispose();
                }

                boolean isValid = x.validate();

                if (isValid)
                {
                    System.err.println( "Valid doc, expected a invalid doc: " );
                    System.err.println( "Instance(" + i + "): " );
View Full Code Here

        for (int i = 0 ; i < invalidDocs.length ; i++)
        {
            XmlObject xo = XmlObject.Factory.parse(invalidDocs[i]);
            assertTrue("Doc was valid. Should be invalid: " + invalidDocs[i],
                ! xo.validate());
        }

        for (int i = 0 ; i < validDocs.length ; i++)
        {
            XmlObject xo = XmlObject.Factory.parse(validDocs[i]);
View Full Code Here

        for (int i = 0 ; i < validDocs.length ; i++)
        {
            XmlObject xo = XmlObject.Factory.parse(validDocs[i]);
            assertTrue("Doc was invalid. Should be valid: " + validDocs[i],
                xo.validate());
        }
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.