[xsd-users] Error with sequences using xsd 3.1.x
Jullien Patrick
pjullien at sopragroup.com
Wed Jun 4 11:43:05 EDT 2008
Hi Boris,
I have migrated our xsd installation to version 3.1.0, thank you for
your tip on dealing with dates.
I'm in front of another problem using sequences, my program stops with a
segfault while calling the sequence_common(const sequence_common&v,
flags f, container *c) when it calls the _clone method.
Because of the migration of xsd, I don't know if the bug is mine or not.
Because of the high volume of xsd and source data, I don't what to give
you to point where the problem is...
My xsd contains this complex type:
<xs:complexType name="descripDonneesType">
<xs:sequence>
<xs:element name="descripEnregistrement"
type="descripEnregistrementType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
...
</xs:complexType>
The complex type descripEnregistrementType is composed like this:
<xs:complexType name="descripEnregistrementType">
<xs:sequence>
<xs:element name="descripFormat" type="descripFormatType"/>
<xs:element name="descripTemporel" type="descripTemporelType"/>
<xs:element name="descripFrequentiel"
type="descripFrequentielType"/>
<xs:element name="descripSignaux">
<xs:complexType>
<xs:complexContent>
<xs:extension base="descripSignauxType">
<xs:sequence>
<xs:element name="descripSignal"
type="descripSignalType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
...
<xs:attribute name="pointeurFichier" type="xs:string"
use="optional"/>
<xs:attribute name="IDEnr" type="xs:unsignedShort" use="required"/>
<xs:attribute name="typeDonnees" type="EnumTypeDonnees"
use="required"/>
<xs:attribute name="sousTypeDonnees" type="EnumSousTypeDonnees"
use="required"/>
<xs:attribute name="nomSAR" type="xs:string" use="optional"/>
</xs:complexType>
The one and only root element is that one:
<xs:element name="root_descripDonnees">
<xs:complexType>
<xs:sequence>
<xs:element name="descripDonnees" type="descripDonneesType"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="version" type="xs:string" use="optional"
fixed="0.79"/>
</xs:complexType>
</xs:element>
The mapping files descripteurDonnees.[ch]xx are generated using cxx with
cxx-tree mode and --generate-ostream --generate-serialization
--root-element-all
The descripteurDonnees.cxx contains a method for getting the
descripEnregistrement_sequence reference:
descripDonneesType::descripEnregistrement_sequence&
descripDonneesType::descripEnregistrement()
{
return this->descripEnregistrement;
}
In one of my classes, I try to get the reference like this:
descripDonneesType::descripEnregistrement_sequence seqEnr =
m_pDescripDonnees->descripEnregistrement()
The m_pDescripDonnees is a valid pointer to an instance of the
descripteurDonnees class (containing true data issued from my data file,
I assume correctly parsed and validated), but this call fails in the
file containers.hxx in the loop over base_const_iterator i(v.v_.begin(),
e(v.v_.end()); i!=e; ++i)
Any idea(s) ? Did you ever encoutered such problems ?
Cordially,
Patrick
More information about the xsd-users
mailing list