[xsd-users] ifc xml

Boris Kolpackov boris at codesynthesis.com
Thu Feb 3 09:28:24 EST 2011


Hi Giuseppe,

giuseppe ferrari <giuseppe500 at yahoo.it> writes:

> now , and i hope that is the last problem is to parse the three attribute:
> id,ref and pos in the nillable template; because these attributes are needed
> for parse("at hand", not the xml parsing of codesynthesis or deserialization)
> the ifc.
> In ifc a ref is related to id and a id is related to ref.
> Is possible to modify the nullable_type template for this?

Yes, there are two ways to do this. If you know that these three attributes
are the only ones needed, then you can just have three data members (e.g.,
strings) in the complex_nillable_type wrapper for them. In the parsing
constructor, if nil is true, then you extract these attributes from the
DOM and store them in the data members. Similarly, in the serialization
operator, if _nil() is true, you add these attributes to the DOM element.

If you want a more generic solution which will work with any attributes,
then you can maintain a list of all attributes in complex_nillable_type
that were present when parsing an element with nil=true.

Boris



More information about the xsd-users mailing list