John,
The marshalling framework itself supports the notion of subsitution
groups and this type of mapping can be done using mapping files, however
the source generator doesn't appear smart enough to generate the proper
descriptors for substitution groups. I haven't looked at this area of
the code in quite a while. I don't recall what the hurdle would be in
getting the source generator up to speed in supporting substitution
groups. I'll need to spend a little time digging through the code and
unfortunately my time is very tight right now. I'll try and track this
down over the next couple of days, but I can't promise anything.
Sorry for the inconvenience,
--Keith
John Logsdon wrote:
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]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------