Hi
 
I'm confused about the support castor has for Substitution groups. I've
heard that it supports usage in certain patterns but I'm unable to find
any documentation to back this up.
 
I have been trying to generate source from an xsd schema that contains
various substitution groups and it seems that it only works for
substitution of the root element.
Using the following xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           targetNamespace="http://www.netdev.co.uk";
           xmlns="http://www.netdev.co.uk";
elementFormDefault="qualified">     
  <xs:complexType name="command-type">
    <xs:sequence>
      <xs:element ref="provisionable"/>
    </xs:sequence>
    <xs:attribute name="ctx" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:element name="command" type="command-type">
  </xs:element>
  <xs:element name="create" type="command-type"
substitutionGroup="command">
  </xs:element>
  <xs:complexType name="provisionable-type">
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="version" type="xs:int" use="required"/>
  </xs:complexType>
  <xs:element name="provisionable" type="provisionable-type">
  </xs:element>
  <xs:element name="account" type="provisionable-type"
              substitutionGroup="provisionable"/>
</xs:schema>
 you can generate source code without any errors.
 
However on unmarshalling of the following XML instance document:
 
<?xml version='1.0' encoding='UTF-8'?>
<create xmlns="http://www.netdev.co.uk";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://www.netdev.co.uk
                            firebird.xsd"
        ctx="123">
  <account name="global" version="1"/>
</create>
 
this exception occurs:
unable to find FieldDescriptor for 'account' in ClassDescriptor of
command

If I replace "account" with "provisionable then all is ok.
 
Can anybode help?!
 
Regards
john


-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to