Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.9.6RC3
-
Fix Version/s: None
-
Component/s: XML code generator
-
Labels:None
-
Environment:Operating System: Windows 2000
Platform: PC
-
Bugzilla Id:1867
-
Number of attachments :
Description
When I generate Java code from the following XML Schema, saved in file
Analysenergebnis.xsd, the "desc.setRequired(true)" statement is missing in the
generated file AnalyenergebnisDescriptor.java for the field probeId.
Analysenergebnis.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.deborate.de/dioxin"
xmlns:dxn="http://www.deborate.de/dioxin"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:annotation>
<xsd:documentation xml:lang="de">
Schema für Analysenergebnis XML Dokumente. Beispielinstanzdokument:
Analysenergebnis.xml
</xsd:documentation>
</xsd:annotation>
<xsd:include schemaLocation="Datentypen.xsd"/>
<xsd:element name="analysenergebnis">
<xsd:complexType>
<xsd:sequence minOccurs="0">
<xsd:element name="reg_nr_fn" type="dxn:number8Id" minOccurs="0"/>
<xsd:element name="reg_nr_ds" type="dxn:number8Id" minOccurs="0"/>
<xsd:element name="reg_nr_jahr" type="dxn:jahrType" minOccurs="0"/>
<xsd:element name="kompartimentId" type="dxn:string8DigitIdNotNull"
minOccurs="0"/>
<xsd:element name="standortId" type="dxn:number8Id" minOccurs="0"/>
<xsd:element name="probenahmeId" type="dxn:number8Id"
minOccurs="0"/>
<xsd:element name="probeId" type="dxn:number8Id"/><!-- probeId MUST
APPEAR ONCE AND ONLY ONCE -->
<xsd:element name="bewertungId" type="dxn:number8Id"
nillable="true" minOccurs="0"/>
<xsd:element name="besondereBelastung" type="dxn:string255"
minOccurs="0"/>
<xsd:element name="ergebnisbezug" type="dxn:decP12S2"
nillable="true" minOccurs="0"/>
<xsd:element name="substanztyp" type="dxn:number3Id"
nillable="true" minOccurs="0"/>
<xsd:element name="trockenmasse" type="dxn:number5" nillable="true"
minOccurs="0"/>
<xsd:element name="humusgehalt" type="dxn:number5" nillable="true"
minOccurs="0"/>
<xsd:element name="phWert" type="dxn:decP3S1range1to14"
nillable="true" minOccurs="0"/>
<xsd:element name="kakeff" type="dxn:number5" nillable="true"
minOccurs="0"/>
<xsd:element name="wiederauffindungsrate" type="dxn:number5"
nillable="true" minOccurs="0"/>
<xsd:element name="analysenergebnisdaten"
type="dxn:analysenergebnisdatenType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="analysenergebnisdatenType">
<xsd:sequence>
<xsd:element name="stoffspektrumId" type="dxn:number5Id"/>
<xsd:element name="analysenergebnisM1" type="dxn:decP14S6"
nillable="true" minOccurs="0"/>
<xsd:element name="analysenergebnisM1Einheit" type="dxn:string50"
minOccurs="0"/>
<xsd:element name="bestimmungsgrenzeB1" type="dxn:decP14S6"
nillable="true" minOccurs="0"/>
<xsd:element name="bestimmungsgrenzeB1Einheit" type="dxn:string50"
minOccurs="0"/>
<xsd:element name="kennzeichen" type="dxn:string4Kennzeichen"
minOccurs="0"/>
<xsd:element name="anmerkung" type="dxn:string50" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="id" type="dxn:number8Id"/>
</xsd:complexType>
</xsd:schema>
snippet of generated class AnalysenergebnisDescriptor.java:
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl
(java.lang.Integer.class, "_probeId", "probeId",
org.exolab.castor.xml.NodeType.Element);
handler = (new org.exolab.castor.xml.XMLFieldHandler() {
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
public void setValue( java.lang.Object object, java.lang.Object
value)
throws IllegalStateException, IllegalArgumentException
{
try
catch (java.lang.Exception ex)
{ throw new IllegalStateException(ex.toString()); } }
public java.lang.Object newInstance( java.lang.Object parent )
} );
desc.setHandler(handler);
desc.setNameSpaceURI("http://www.deborate.de/dioxin");
//THIS STATEMENT IS MISSING HERE **"desc.setRequired(true);"**
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _probeId
fieldValidator = new org.exolab.castor.xml.FieldValidator();
desc.setValidator(fieldValidator);
//-- _bewertungId
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl
(java.lang.Integer.class, "_bewertungId", "bewertungId",
org.exolab.castor.xml.NodeType.Element);
to generate the code I typed:
>java org.exolab.castor.builder.SourceGenerator -i Analysenergebnis.xsd -types
j2 -package de.deborate...REST OF THE PACKAGENAME
Matthias, I know this is months too late(if not years), but what's the chances of attaching the missing Datentypen.xsd ?