ws-jaxme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Veniamin Fichin <3ca28...@mail.ru>
Subject xsd:enumeration question
Date Mon, 31 May 2004 12:42:36 GMT
Hello all!

    First thank to all the people who works at JaxMe, it's very handy 
and saves me a lot of work. :-)
    This was lyric. :-) Ths question is: is there support for 
<xsd:enumeration ...> schema tag in JaxMe? Schema snippet is:

    <xsd:element name="Apartment" minOccurs="0">
     <xsd:annotation>
      <xsd:documentation>...</xsd:documentation>
     </xsd:annotation>
     <xsd:complexType mixed="true">
      <xsd:attribute name="id">
       <xsd:annotation>
        <xsd:documentation>...</xsd:documentation>
       </xsd:annotation>
       <xsd:simpleType>
<!--                 ^line 27 column 22 -->
        <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Flat"/>
         <xsd:enumeration value="Area"/>
        </xsd:restriction>
       </xsd:simpleType>
      </xsd:attribute>
     </xsd:complexType>
    </xsd:element>

    JaxMe tells me that:

...\build.xml:17: org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At 
file:/.../schema.xsd, line 72, column 22: Unable to derive package name 
from an empty namespace URI. Use the schemaBindings to specify a package 
name.

    Line 72 column 22 is the end of start <xsd:simpleType> tag, and 
enumerations occur a triple of times in schema, and in each that 
occurrence this error rises. So what namespace does it want?
    As far as I know XML Schema (_very_ little knowledge) this 
restriction should apply to content of parent node, "id" attribute in 
this case. And for the Java class it should produce somethins like this:

public viod setId (String id) {
     if (!id.equals("Flat") && !id.equals("Area"))
         throw new IllegalArgumentException("...");
     this.id=id;
}

    instead of just "this.id=id;".



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


Mime
View raw message