users@jaxb.java.net

fixed attribute values are lost

From: <bgabor_at_cs.mcgill.ca>
Date: Thu, 22 Jan 2004 17:53:06 -0500 (EST)

I'm trying to compile the schema below. The problem is that the
fixed-value attribute InName of the Input1 type is not showing up in the
resulting class. However the fixed-value attribute RName of BRIMsgType
does show up. Is this because the former is only declared to be fixed in a
derived type? Or an anonymous type? How do I get around this problem?

Thanks.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
  xmlns="http://www.bgabor.com/expdb"
  targetNamespace="http://www.bgabor.com/expdb"
  elementFormDefault="qualified"
  jaxb:version="1.0">

<xsd:annotation>
  <xsd:appinfo>
   <jaxb:globalBindings fixedAttributeAsConstantProperty="true"/>
  </xsd:appinfo>
</xsd:annotation>

<xsd:element name="BRIMsg" type="BRIMsgType" />

<xsd:complexType name="BRIMsgType">
  <xsd:sequence>
     <xsd:element name="RInputs" type="InputList"/>
  </xsd:sequence>
  <xsd:attribute name="RName" type="xsd:string" fixed="BRI"/>
  <xsd:attribute name="mid" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>

<xsd:complexType name="InputList">
  <xsd:sequence>
   <xsd:element name="Input1">
    <xsd:complexType>
     <xsd:complexContent>
       <xsd:restriction base="GenericInput">
         <xsd:attribute name="InName" type="xsd:string" fixed="i1"/>
       </xsd:restriction>
     </xsd:complexContent>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="GenericInput">
  <xsd:attribute name="InName" type="xsd:string"/>
  <xsd:attribute name="InValue" type="xsd:string" use="required"/>
</xsd:complexType>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net