src/test/java/org/jboss/test/util/test/xml/resolver/JBossEntityResolverUnitTestCase.java
/**
    * The spcial thing about the resolution of xsd:redefine is that
    * the parser passes the namespace of the redefining schema as publicId
    * and the schema location of the redefined schema as systemId. Now, if
    * the redefining schema's namespace has already been mapped
    * to a schema location of the redefining schema then schema location
    * argument is ignored and the redefining schema is returned instead of the
    * redefined schema.
    * 
    * @throws Exception
    */
The spcial thing about the resolution of xsd:redefine is that
the parser passes the namespace of the redefining schema as publicId
and the schema location of the redefined schema as systemId. Now, if
the redefining schema's namespace has already been mapped
to a schema location of the redefining schema then schema location
argument is ignored and the redefining schema is returned instead of the
redefined schema.

@throws Exception
The spcial thing about the resolution of xsd : redefine is that the parser passes the namespace of the redefining schema as publicId and the schema location of the redefined schema as systemId . Now if the redefining schema ' s namespace has already been mapped to a schema location of the redefining schema then schema location argument is ignored and the redefining schema is returned instead of the redefined schema . @throws Exception
public void testResolveRedefine() throws Exception
   {
      String baseName = getRootName() + "_" + getName() + "_";
      String redefiningName = baseName + "redefining.xsd";
      InputStream redefiningStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(redefiningName);
      assertNotNull("Expected to find " + redefiningName + " in the classpath", redefiningStream);
      int redefiningSize = bytesTotal(redefiningStream);
      String redefinedName = baseName + "redefined.xsd";
      InputStream redefinedStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(redefinedName);
      assertNotNull("Expected to find " + redefinedName + " in the classpath", redefinedStream);
      int redefinedSize = bytesTotal(redefinedStream);
      assertTrue(redefiningSize != redefinedSize);
      JBossEntityResolver resolver = new JBossEntityResolver();
      resolver.registerLocalEntity("urn:jboss:xml:test", redefiningName);
      InputSource resolvedSource = resolver.resolveEntity("urn:jboss:xml:test", redefinedName);
      assertNotNull(resolvedSource);
      InputStream resolvedStream = resolvedSource.getByteStream();
      assertNotNull(resolvedStream);
      int resolvedSize = bytesTotal(resolvedStream);
      assertEquals("Schema sizes: redefined=" + redefinedSize + ", redefining=" + redefiningSize, redefinedSize, resolvedSize);
   }
public void testResolveRedefine ( ) throws Exception { String baseName = getRootName ( ) + "_" + getName ( ) + "_" ; String redefiningName = baseName + "redefining.xsd" ; InputStream redefiningStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( redefiningName ) ; assertNotNull ( "Expected to find " + redefiningName + " in the classpath" , redefiningStream ) ; int redefiningSize = bytesTotal ( redefiningStream ) ; String redefinedName = baseName + "redefined.xsd" ; InputStream redefinedStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( redefinedName ) ; assertNotNull ( "Expected to find " + redefinedName + " in the classpath" , redefinedStream ) ; int redefinedSize = bytesTotal ( redefinedStream ) ; assertTrue ( redefiningSize != redefinedSize ) ; JBossEntityResolver resolver = new JBossEntityResolver ( ) ; resolver . registerLocalEntity ( "urn:jboss:xml:test" , redefiningName ) ; InputSource resolvedSource = resolver . resolveEntity ( "urn:jboss:xml:test" , redefinedName ) ; assertNotNull ( resolvedSource ) ; InputStream resolvedStream = resolvedSource . getByteStream ( ) ; assertNotNull ( resolvedStream ) ; int resolvedSize = bytesTotal ( resolvedStream ) ; assertEquals ( "Schema sizes: redefined=" + redefinedSize + ", redefining=" + redefiningSize , redefinedSize , resolvedSize ) ; }
The spcial thing about the resolution of xsd:redefine is that
 the parser passes the namespace of the redefining schema as publicId
 and the schema location of the redefined schema as systemId.
The spcial thing about the resolution of xsd : redefine is that the parser passes the namespace of the redefining schema as publicId and the schema location of the redefined schema as systemId .