You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Ralf <ps...@web.de> on 2006/10/20 01:43:17 UTC

Is there a possibility to compile this simplecontent restriction

Hi!

I try to compile a subset of the gml.xsd (OGC). There are these two types
derived from each other:

   <complexType name="CodeType">
    <simpleContent>
      <extension base="xsd:string">
        <attribute name="codeSpace" type="anyURI" use="optional"/>
      </extension>
    </simpleContent>
   </complexType>


   <complexType name="SimpleNameType">
    <simpleContent>
     <restriction base="gml:CodeType">
       <attribute name="codeSpace" type="anyURI" use="prohibited"/>
     </restriction>
    </simpleContent>
   </complexType>

When I use scomp to generate the code and after that the javac to compile the
generated code there is this error:

net.opengis.gml.impl.SimpleNameTypeImpl is not abstract and does not override
  abstract method unsetCodeSpace() in net.opengis.gml.CodeType
public class SimpleNameTypeImpl extends
org.apache.xmlbeans.impl.values.JavaStringHolderEx implements
net.opengis.gml.SimpleNameType

The interface SimpleNameType correctly implements the interface CodeType. But
the SimpleNameTypeImpl does not implement the methods to access the attribute
codespace (also correct, because it is "prohibited" there).

Is there a solution for this conflict? Is the gml schema wrong? What can I do to
solve this problem?
Thank you for reading my probs! Best regards Ralf



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


Re: Is there a possibility to compile this simplecontent restriction

Posted by Ralf <ps...@web.de>.
Radu Preotiuc-Pietro <radup <at> bea.com> wrotes:

> 
> Looks like you have hit a bug. Because you are removing an attribute,
> the Java impl class does not implement that method, which was present in
> the base. Hm, I'll look into it.
> 
> Radu
> 

It seems to be difficult to map this schema restriction to valid java code. 

My work around at the moment is to compile with scomp without compiling with
javac. After that I add the required methods and try to remember not to use the
"prohibited" getters and setters later. 

But the required interaction between scomp and javac is a problem for automated
builds (nightly builds) :/

Ralf


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


Re: Is there a possibility to compile this simplecontent restriction

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Looks like you have hit a bug. Because you are removing an attribute,
the Java impl class does not implement that method, which was present in
the base. Hm, I'll look into it.

Radu

On Thu, 2006-10-19 at 16:43 -0700, Ralf wrote:
> Hi!
> 
> I try to compile a subset of the gml.xsd (OGC). There are these two
> types
> derived from each other:
> 
>    <complexType name="CodeType">
>     <simpleContent>
>       <extension base="xsd:string">
>         <attribute name="codeSpace" type="anyURI" use="optional"/>
>       </extension>
>     </simpleContent>
>    </complexType>
> 
> 
>    <complexType name="SimpleNameType">
>     <simpleContent>
>      <restriction base="gml:CodeType">
>        <attribute name="codeSpace" type="anyURI" use="prohibited"/>
>      </restriction>
>     </simpleContent>
>    </complexType>
> 
> When I use scomp to generate the code and after that the javac to
> compile the
> generated code there is this error:
> 
> net.opengis.gml.impl.SimpleNameTypeImpl is not abstract and does not
> override
>   abstract method unsetCodeSpace() in net.opengis.gml.CodeType
> public class SimpleNameTypeImpl extends
> org.apache.xmlbeans.impl.values.JavaStringHolderEx implements
> net.opengis.gml.SimpleNameType
> 
> The interface SimpleNameType correctly implements the interface
> CodeType. But
> the SimpleNameTypeImpl does not implement the methods to access the
> attribute
> codespace (also correct, because it is "prohibited" there).
> 
> Is there a solution for this conflict? Is the gml schema wrong? What
> can I do to
> solve this problem?
> Thank you for reading my probs! Best regards Ralf
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

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