[xsd-users] AnyType and the extraction of contents

Daniel Kåsa daniel.kaasa at gmail.com
Tue May 12 15:14:10 EDT 2020


The schema type which I am using is from the following
http://schemas.opengis.net/om/2.0/observation.xsd.  The type that is
returned and which is valid for the element "result" is anyType, however it
is not initialized with the "flags::extract_contents". if I drop
"--generate-polymorphic" then anyType is initialized with the
"flags:extract_contents" and I have no longer an issue.

Without generating polymorphic and importing of maps:
1. It is possible to access the content using dom_content().
2. The parsed anyType is also written when serialized.

With generating polymorphic and importing of maps:
1. It is *not* possible to access the content using dom_content().
2. The parsed anyType is *not* written when serialized.

Can we assume that these two modes may not be used simultaneously then?

Thank you for your help!
Daniel

On Tue, May 12, 2020 at 1:16 PM Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Daniel Kĺsa <daniel.kaasa at gmail.com> writes:
>
> > Snip from the generated "observation.xsd" OGC Observation & Measurements
> > schema:
> >
> > ---------------------------- snip ------------------------------
> > // result
> > //
> > {
> >   ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
> >     ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
> >       "result",
> >       "http://www.opengis.net/om/2.0",
> >       &::xsd::cxx::tree::factory_impl< result_type >,
> >       true, true, i, n, f, this));
>
> This suggests that anyType is treated as a polymorphic type. What is the
> semantics of this `result` element? Is it part of a substitution group?
> If so, perhaps what you are getting in your object model if not anyType
> but an instance of one of its derived types? That would explain why you
> are not seeing any DOM content.
>


More information about the xsd-users mailing list