You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org> on 2005/01/27 01:13:20 UTC

[jira] Resolved: (XMLBEANS-77) Inconsistent namespace for imported groups

     [ http://issues.apache.org/jira/browse/XMLBEANS-77?page=history ]
     
Radu Preotiuc-Pietro resolved XMLBEANS-77:
------------------------------------------

     Resolution: Fixed
    Fix Version: Version 2 Beta 2
                 Version 2

SVN revision 126561.


> Inconsistent namespace for imported groups
> ------------------------------------------
>
>          Key: XMLBEANS-77
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-77
>      Project: XMLBeans
>         Type: Bug
>   Components: Compiler
>     Reporter: Radu Preotiuc-Pietro
>     Assignee: Radu Preotiuc-Pietro
>      Fix For: Version 2, Version 2 Beta 1, Version 2 Beta 2

>
> Before the long explanation, I'm importing a group from one namespace 
> into another, and I'm getting elements in different namespaces 
> depending on whether I compile 2 schemas together at once or first one, 
> and then the second with the results of the first on the classpath for 
> the compilation of the second.  The schemas are identical for the two 
> compilation methods.
> I'm really mystified by the following behavior and wonder if it is a 
> bug.
> I have a small schema geronimo-naming.xsd
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema
>      targetNamespace="http://geronimo.apache.org/xml/ns/naming"
>      xmlns:gernaming="http://geronimo.apache.org/xml/ns/naming"
>      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>      elementFormDefault="qualified"
>      attributeFormDefault="unqualified"
>      version="1.0">
>      <xsd:group name="jndiEnvironmentRefsGroup">
>          <xsd:sequence>
>              <xsd:element name="ejb-ref"
>                  type="gernaming:remote-refType"
>                  minOccurs="0" maxOccurs="unbounded"/>
>              <xsd:element name="ejb-local-ref"
>                  type="gernaming:local-refType"
>                  minOccurs="0" maxOccurs="unbounded"/>
>              <xsd:element name="resource-ref"
>                  type="gernaming:local-refType"
>                  minOccurs="0" maxOccurs="unbounded"/>
>              <xsd:element name="resource-env-ref"
>                  type="gernaming:local-refType"
>                  minOccurs="0" maxOccurs="unbounded"/>
>          </xsd:sequence>
>      </xsd:group>
> (types for remote and local-ref ommitted)
> </xsd:schema>
> that is imported into another schema
>      <xs:import namespace="http://geronimo.apache.org/xml/ns/naming" 
> schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
> and referenced like this:
>     <xs:complexType name="application-clientType">
>          <xs:sequence>
> (some elements ommitted)
>              <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
> (more elements ommitted)
>          </xs:sequence>
>      </xs:complexType>
> I compile types for the geronimo-naming schema separately.
> -----------------------------------
> I can compile the types for the referencing application-client schema 
> in two ways, with and without the precompiled geronimo-naming schema 
> classes on the classpath.
> If I compile without the separately compiled classes, xmlbeans 
> generates additional copies of these classes that behave as I expect, 
> namely the resulting document fragments look like this:
> <xml-fragment parentId="parentId" configId="configId" 
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming">
>    <nam:resource-ref>
>      <nam:ref-name>ref</nam:ref-name>
>      <nam:target-name>target</nam:target-name>
>    </nam:resource-ref>
> </xml-fragment>
> Note that as expected thhe resource-ref element is in the nam namespace.
> However, if I include the precompiled schema classes on the classpath 
> when generating xmlbeans code, I get the following fragments:
> <xml-fragment parentId="parentId" configId="configId" 
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming">
>    <resource-ref>
>      <nam:ref-name>ref</nam:ref-name>
>      <nam:target-name>target</nam:target-name>
>    </resource-ref>
> </xml-fragment>
> Note that resource-ref is in no namespace.
> Can anyone explain this?  Is there any way to get the "with-namespace" 
> behavior using the separately compiled classes?
> I'm using xbean-1.0-DEV from the ibiblio maven repository.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org