[xsd-users] Pointers to references

Mathew Benson mathew.benson at gmail.com
Fri Feb 28 11:38:50 EST 2014


Ok.  Thanks.  Since I'm using an already documented and standardized
schema, I'm leery about modifying the schema file.  I just wish they would
have considered that when the schema was defined.


On Fri, Feb 28, 2014 at 9:05 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Mathew,
>
> Mathew Benson <mathew.benson at gmail.com> writes:
>
> > <SomeElement name="Object1"/>
> > <AnotherElement someElementRef="Object1"/>.
>
> If your schema uses xs:ID type for 'name' and xs:IDREF for
> 'someElementRef', then, yes, XSD will resolve such references
> for you. See:
>
> http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.5.5
>
>
> > Is it generating skeletal code that I can/should modify, or should I
> > treat it as autocode that can be regenerated and should not be modified
> > directly?
>
> The generated code should not be modified but there is a mechanism
> for customizing the generated classes. For more information on type
> customization see the C++/Tree Mapping Customization Guide:
>
> http://wiki.codesynthesis.com/Tree/Customization_guide
>
> As well as the examples in the examples/cxx/tree/custom/ directory.
>
> So if ID/IDREF does not apply (i.e., your schema uses key/keyref),
> then the next best thing is to customize the generated classes to
> add the pointers and to initialize them in the parsing constructors.
>
> Boris
>


More information about the xsd-users mailing list