[xsd-users] Parsing for the substitutionGroup

Ninh Tran Dang tdninh at tma.com.vn
Thu Mar 6 04:16:22 EST 2008


Thanks Boris. 

 

I got problem when using Tree mapping to the configNameType below. When
parsing with the elements in the "config-name" substitutionGroup like:
startup, candidate, running, I received the same object of configNameType
for startup, candidate and running. So how to differentiate and get the
correct element in this case? 

 

The most important thing is how to know the incoming element name (startup,
candidate, or running) when they are defined to the same type of
configNameType.

 

Thanks,

Ninh

<xs:complexType name="configNameType"/>

            <xs:element name="config-name" type="configNameType"
abstract="true"/>

            <xs:element name="startup" type="configNameType"
substitutionGroup="config-name"/>

            <xs:element name="candidate" type="configNameType"
substitutionGroup="config-name"/>

      <xs:element name="running" type="configNameType"
substitutionGroup="config-name"/>

 

 

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Thursday, March 06, 2008 2:41 PM
To: Ninh Tran Dang
Cc: xsd-users at codesynthesis.com; dangninhtran at vnn.vn
Subject: Re: [xsd-users] Parsing for the substitutionGroup

 

Hi Ninh,

 

Ninh Tran Dang <tdninh at tma.com.vn> writes:

 

> I tried the XSD for the substitutionGroup defintion, and I got another

> problem when parsing the elements in the substitutionGroup with the same

> element type (not the derived type as the example of 5.4 section -

>
http://www.codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#5.

> 4).

 

I've tested same-type substitution groups and they work fine for me.

Here is the test case I used:

 

http://www.codesynthesis.com/~boris/tmp/same-type.tar.gz

 

If this still does not work for you, can you be more specific about

the problem you are experiencing?

 

Boris




More information about the xsd-users mailing list