[xsde-users] Regarding xsde error "expected element not encountered"
manjunatha srinivasan
manjunathan.n at gmail.com
Wed Jul 7 14:00:46 EDT 2021
Hi
I am facing error as below :
I am new to XSDe kind of coding development. With my existing setup of my
project which has schema '*.xsd' files can generate cpp and h files for
parser and serializer using xsde binary. I made changes in the schema file
for adding an element called * '**listdata' *based on the list (sequence)
of data type* 'listdatatype'*. This element 'listdata' is an element under
'mydata' element. Same time the 'mydata' element contains other elements
like data1/data2. With addition of 'listdata' to 'mydata' as an element, I
again re-generated h and cpp parser/serializer files. By referring sample
changes (i.e. cpp & h files) of existing working of list entity and data
entity in separate conditions, here I merged together, so aim is it will
return both data1/data2 and listdata together in serializer. But facing
below error with changes as said before.
*error: expected element not encountered*
My question is how to debug these kinds of errors, to exactly point to the
file/line or element name which is causing the error. Can we generate log
while parsing and serializing. I am testing this linux environment.
Please help me out for better debugging.
Here I have provided sample schema changes as below in common.xsd
/reply.xsd files:
--common.xsd---
<xsd:complexType name=*"listdatatype"*>
<xsd:sequence>
<xsd:element name="listmember1" type="xsd:string">
<xsd:annotation>
<xsd:documentation
xml:lang="en"><intro>listmember1</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="listmember2" type="xsd:string">
<xsd:annotation>
<xsd:documentation
xml:lang="en"><intro>listmember2</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="listmember3" type="xsd:string">
<xsd:annotation>
<xsd:documentation
xml:lang="en"><intro>listmember3</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
------reply.xsd----
<xsd:element name=*"mydata"*>
<xsd:annotation>
<xsd:documentation
xml:lang="en"><intro>mydata</intro><errorCodes><code
name="fail1"/></errorCodes></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="data1"
type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en"><intro>data1</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="data2"
type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en"><intro>data2</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name=
*"listdata"*>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="mylist">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="aboutlist" type="*mt:listdatatype*"
minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation
xml:lang="en"><intro>details</intro></xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
--
Thanks
Manjunatha Srinivasan N
More information about the xsde-users
mailing list