Package org.apache.xmlbeans

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


        Assert.assertTrue(
            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );

        x = XmlObject.Factory.parse(
            "<schema xmlns='http://www.w3.org/2001/XMLSchema/moo'/>" );
        Assert.assertTrue( x.schemaType() == XmlBeans.NO_TYPE );

        x = XmlObject.Factory.parse(
            "<schema xmlns='http://www.w3.org/2001/XMLSchema'/>" );
        Assert.assertTrue(
            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );
View Full Code Here


        Assert.assertTrue( x.schemaType() == XmlBeans.NO_TYPE );

        x = XmlObject.Factory.parse(
            "<schema xmlns='http://www.w3.org/2001/XMLSchema'/>" );
        Assert.assertTrue(
            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );

        x = org.w3.x2001.xmlSchema.SchemaDocument.Factory.parse(
                "<schema xmlns='http://www.w3.org/2001/XMLSchema'/>" );
        Assert.assertTrue(
            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );
View Full Code Here

            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );

        x = org.w3.x2001.xmlSchema.SchemaDocument.Factory.parse(
                "<schema xmlns='http://www.w3.org/2001/XMLSchema'/>" );
        Assert.assertTrue(
            x.schemaType() == org.w3.x2001.xmlSchema.SchemaDocument.type );

        try {
            x =
                org.w3.x2001.xmlSchema.SchemaDocument.Factory.parse(
                    "<schema xmlns='http://www.w3.org/2001/XMLSchema/moo'/>" );
View Full Code Here

            {
                for (int i = 0; i < ITERATION_COUNT; i++)
                {
                    SchemaTypeLoader loader = XmlBeans.loadXsd(new XmlObject[] { XmlObject.Factory.parse(TestEnv.xbeanCase("schema/XmlSignature/xmldsig-core-schema.xsd")) });
                    XmlObject result = loader.parse(TestEnv.xbeanCase("schema/XmlSignature/signature-example.xml"), null, null);
                    Assert.assertEquals(loader.findDocumentType(new QName("http://www.w3.org/2000/09/xmldsig#", "Signature")), result.schemaType());
                }
                _result = true;
            }
            catch (Throwable t)
            {
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
    {
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
    {
View Full Code Here

    protected static XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) throws DeploymentException {
               //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
        XmlObject[] converted = new XmlObject[xmlObjects.length];
        for (int i = 0; i < xmlObjects.length; i++) {
            XmlObject xmlObject = xmlObjects[i].copy();
            if (xmlObject.schemaType() != type) {
                converter.convertElement(xmlObject);
                converted[i] = xmlObject.changeType(type);
            } else {
                converted[i] = xmlObject;
            }
View Full Code Here

      in = Thread.currentThread(  ).getContextClassLoader(  ).getResourceAsStream( RESOURCE_PATH_SUSHI_METADATA_XML );
      DefinitionsDocument    metadataDocXBean = (DefinitionsDocument) XmlObject.Factory.parse( in );
      MetadataDescriptorType metadataDesc = metadataDocXBean.getDefinitions(  ).getMetadataDescriptorArray( 0 );
      in.close(  );
      ResourcePropertySetMetaData propSetMetaData =
         new XmlBeansResourcePropertySetMetaData( propsDocXBean.schemaType(  ), metadataDesc );
      m_resourcePropSet = new XmlBeansResourcePropertySet( propsDocXBean, propSetMetaData );
   }

   private static boolean compileSchema( File xsdFile )
   {
View Full Code Here

         XmlObject siblingXmlObject      = xCursor.getObject(  );
         QName     siblingXmlObjectQname = getName( siblingXmlObject );

         // TODO (low priority): should this be tested against the original bean?
         //if it contains the ElementProperty, then it is not an Any
         if ( siblingXmlObject.schemaType(  ).getElementProperty( siblingXmlObjectQname ) != null )
         {
            continue;
         }

         //check to see if we have a xmlObjectList to add to for this QName
View Full Code Here

                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
                if (result == null || result.schemaType() != desiredType) {
                    result = temp.copy().changeType(desiredType);
                }
                validateDD(result);
                return result;
            } else {
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.