[xsde-users] Absent .pre() and .post() methods in some aggregators

Песоцкий Максим aazmp at yandex.ru
Mon Nov 19 10:13:22 EST 2018


Greetings!

i'm trying to port project from using XSD cxx-tree to XSD/e cxx-hybrid to reduce memory usage
Sadly without much knowledge of both

Getting started guide suggests, that serialization of root elements is going like this

for 
rs::productMetadata::EarthObservationType eoType;

rs::productMetadataResursBmi::EarthObservation_saggr elem_s;
xml_schema::document_simpl doc_s(elem_s.root_serializer(), elem_s.root_name (), true);
elem_s.pre(eoType);
doc_s.serialize (mystream, xml_schema::document_simpl::pretty_print);
elem_s.post();

but sometimes aggregators do not have .pre() and .post() functions (i.e with this rs::productMetadataResursBmi::EarthObservation_saggr/_paggr)
is this correct situation?

options used with xsde cxx-hybrid --generate-polymorphic --generate-serializer --generate-aggregate --generate-parser



type is defined like this (separated into several different namespaces and .xsd files)
<xs:element name="EarthObservation" type="productMetadata:EarthObservationType" substitutionGroup="opt:EarthObservation">
		<xs:annotation>
			<xs:documentation>Root element for level 0 product description</xs:documentation>
		</xs:annotation>
	</xs:element>

it's line of base type/elements is:
1.
<xs:element name="EarthObservation" type="opt:EarthObservationType" substitutionGroup="eop:EarthObservation">
		<xs:annotation>
			<xs:documentation>eop root element for Optical Earth Observation Product description</xs:documentation>
		</xs:annotation>
	</xs:element>

2. 
<xs:element name="EarthObservation" type="eop:EarthObservationType" substitutionGroup="gml:Observation">
		<xs:annotation>
			<xs:documentation>eop root element for generic Earth Observation Product description</xs:documentation>
		</xs:annotation>
	</xs:element>

3. 
<element name="Observation" type="gml:ObservationType" substitutionGroup="gml:_Feature"/>
	<!-- ================================================= -->
	<complexType name="ObservationType">
		<complexContent>
			<extension base="gml:AbstractFeatureType">
				<sequence>
					<element ref="gml:validTime" minOccurs="0"/>
					<element ref="gml:using" minOccurs="0"/>
					<element ref="gml:target" minOccurs="0"/>
					<element ref="gml:resultOf" minOccurs="0"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>

4. 
<complexType name="AbstractFeatureType" abstract="true">
		<annotation>
			<documentation>An abstract feature provides a set of common properties, including id, metaDataProperty, name and description inherited from AbstractGMLType, plus boundedBy.    A concrete feature type must derive from this type and specify additional  properties in an application schema. A feature must possess an identifying attribute ('id' - 'fid' has been deprecated).</documentation>
		</annotation>
		<complexContent>
			<extension base="gml:AbstractGMLType">
				<sequence>
					<element ref="gml:boundedBy" minOccurs="0"/>
					<element ref="gml:location" minOccurs="0">
						<annotation>
							<appinfo>deprecated</appinfo>
							<documentation>deprecated in GML version 3.1</documentation>
						</annotation>
					</element>
					<!-- additional properties must be specified in an application schema -->
				</sequence>
			</extension>
		</complexContent>
	</complexType>

5.
<complexType name="AbstractGMLType" abstract="true">
		<annotation>
			<documentation>All complexContent GML elements are directly or indirectly derived from this abstract supertype 
	to establish a hierarchy of GML types that may be distinguished from other XML types by their ancestry. 
	Elements in this hierarchy may have an ID and are thus referenceable.</documentation>
		</annotation>
		<sequence>
			<group ref="gml:StandardObjectProperties"/>
		</sequence>
		<attribute ref="gml:id" use="optional"/>
	</complexType>

Tried also to generate all schemes in single call with with root-element-all
also defined these types polyporphic



Thanks!

Maxim



More information about the xsde-users mailing list