Examples of DefaultSchemaResolver


Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

         Method method = clazz.getMethod("initResolver", null);
         defaultResolver = (SchemaBindingResolver) method.invoke(null, null);
      }
      catch (NoSuchMethodException ignored)
      {
         defaultResolver = new DefaultSchemaResolver();
      }
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

         Method method = clazz.getMethod("initResolver", (Class[]) null);
         defaultResolver = (SchemaBindingResolver) method.invoke(null, (Object[]) null);
      }
      catch (NoSuchMethodException ignored)
      {
         defaultResolver = new DefaultSchemaResolver();
      }
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

         Method method = clazz.getMethod("initResolver", null);
         defaultResolver = (SchemaBindingResolver) method.invoke(null, null);
      }
      catch (NoSuchMethodException ignored)
      {
         defaultResolver = new DefaultSchemaResolver();
      }
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

*/
public class SchemaIncludeUnitTestCase extends BaseTestCase
{
   public void testSimpleInclude() throws Exception
   {
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      URL url = getClass().getResource("/xml/SchemaIncludeUnitTestCase.xsd");
      assertNotNull(url);
      Util.loadSchema(url.toString(), resolver);
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

      Util.loadSchema(url.toString(), resolver);
   }

   public void testComplexInclude() throws Exception
   {
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      URL url = getClass().getResource("/xml/SchemaIncludeUnitTestCase.xsd");
      assertNotNull(url);
      resolver.addSchemaLocation("urn:jbosstest:schemainclude", url.toString());
      Util.loadSchema(url.toString(), resolver);
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

public class SchemaBindingInitializerUnitTestCase extends AbstractJBossXBTest
{
   public static SchemaBindingResolver initResolver() throws Exception
   {
      Class clazz = SchemaBindingInitializerUnitTestCase.class;
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaInitializer(SimpleInitializer.NS, SimpleInitializer.class.getName());
      String location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseSimple.xsd");
      resolver.addSchemaLocation(SimpleInitializer.NS, location);
      resolver.addSchemaInitializer(ContainerInitializer.NS, ContainerInitializer.class.getName());
      location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseContainer.xsd");
      resolver.addSchemaLocation(ContainerInitializer.NS, location);
      return resolver;
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

   public void testXercesBug()
   {
      String name = "xml/xerces-bug.xsd";
      URL xsdUrl = Thread.currentThread().getContextClassLoader().getResource(name);

      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.setBaseURI(xsdUrl.toString());
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      setResourceResolver(schemaLoader, resolver);
      setDOMErrorHandler(schemaLoader);
      XSModel model = schemaLoader.loadURI(xsdUrl.toString());
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

   }

   public void testSchema1() throws Exception
   {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaLocation("urn:jboss:jbxb-minOccurs-schema1", "xml/jbxb/minOccurs/schema1.xsd");

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      URL testSchema1 = loader.getResource("xml/jbxb/minOccurs/testSchema1.xml");
      Object root = unmarshaller.unmarshal(testSchema1.toString(), resolver);
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

   }

   public void testSchema1v2() throws Exception
   {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaLocation("urn:jboss:jbxb-minOccurs-schema1", "xml/jbxb/minOccurs/schema1v2.xsd");

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      URL testSchema1 = loader.getResource("xml/jbxb/minOccurs/testSchema1.xml");
      Object root = unmarshaller.unmarshal(testSchema1.toString(), resolver);
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver

              "  targetNamespace='http://www.jboss.org/xml/test/xop'>" +
              "  <import namespace='http://www.w3.org/2005/05/xmlmime' schemaLocation='xmlmime.xsd'/>" +
              "  <element name='applxml' xmime:expectedContentTypes='application/xml' type='xmime:base64Binary'/>" +
              "</schema>";

      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      String xmimeXsd = getSchemaLocation(getClass(), "xmlmime.xsd");
      resolver.addSchemaLocation("http://www.w3.org/2005/05/xmlmime", xmimeXsd);

      SchemaBinding schema = XsdBinder.bind(new StringReader(xsd), null, resolver);
      schema.setIgnoreUnresolvedFieldOrClass(false);
      schema.setXopUnmarshaller(XOP_ENABLED_UNMARSH);
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.