Package org.apache.xmlbeans

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


                        StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
                            configFiles[i], "xsd config"
                        }, configdoc);
                    } else {
                        StscState.addInfo(errorListener, "Loading config file " + configFiles[i]);
                        if (configdoc.validate(new XmlOptions().setErrorListener(errorListener))) {
                            ConfigDocument.Config config = ((ConfigDocument)configdoc).getConfig();
                            cdoclist.add(config);
                            config.setExtensionArray(new Extensionconfig[] {});
                        }
                    }
View Full Code Here


                        StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
                            configFiles[i], "xsd config"
                        }, configdoc);
                    } else {
                        StscState.addInfo(errorListener, "Loading config file " + configFiles[i]);
                        if (configdoc.validate(new XmlOptions().setErrorListener(errorListener))) {
                            ConfigDocument.Config config = ((ConfigDocument)configdoc).getConfig();
                            cdoclist.add(config);
                            config.setExtensionArray(new Extensionconfig[] {});
                        }
                    }
View Full Code Here

            if (xobj.schemaType() == XmlObject.type)
            {
                System.out.println(instanceFiles[i] + " NOT valid.  ");
                System.out.println("  Document type not found." );
            }
            else if (xobj.validate(new XmlOptions().setErrorListener(errors)))
                System.out.println(instanceFiles[i] + " valid.");
            else
            {
                System.out.println(instanceFiles[i] + " NOT valid.");
                for (Iterator it = errors.iterator(); it.hasNext(); )
View Full Code Here

                    }
                    else
                    {
                        StscState.addInfo(errorListener, "Loading schema file " + xsdFiles[i]);
                        XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
                        if (schemadoc.validate(opts))
                            scontentlist.add(((SchemaDocument)schemadoc).getSchema());
                    }
                }
                catch (XmlException e)
                {
View Full Code Here

                    if (!(configdoc instanceof ConfigDocument))
                        StscState.addError(errorListener, "Document " + configFiles[i] + " is not an xsd config file", XmlErrorContext.CANNOT_LOAD_XSD_FILE, configdoc);
                    else
                    {
                        StscState.addInfo(errorListener, "Loading config file " + configFiles[i]);
                        if (configdoc.validate(new XmlOptions().setErrorListener(errorListener)))
                            cdoclist.add(((ConfigDocument)configdoc).getConfig());
                    }
                }
                catch (XmlException e)
                {
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 ( ; ; )
        {
            XmlObject obj = c.getObject();

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

            if (c.toNextToken().isNone())
                break;
        }
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.