[Xml-compile] How to read an abstract element with xsi:type attribute?

Roman Daniel roman.daniel at davosro.cz
Sat Dec 19 16:20:29 GMT 2009


I understand, I don't expect to parse the XML with xsi:type by single reader
without using hooks.

I only wander if there is other possibility to parse a already extracted
abstract element with xsi:type than:
- create an artificial schema defining an element for concrete type
- change the abstract element to concrete one described above

 Roman

2009/12/19 Mark Overmeer <mark at overmeer.net>

> * Roman Daniel (roman.daniel at davosro.cz) [091219 15:10]:
> > while parsing xml with abstract element substituted by concrete one I r=
un
> into
> > a problem how to read:
> >
> > <myabstractns:myAbstractElem xsi:type=3D"myconcretens:myConcreteType at=
tr=3D
> > "value">
> > ...some content
> > </myabstractns:myAbstractElem>
>
> xsi:type is not (yet) supported. Since a few years, we have the much
> nicer concept of substitutionGroups. That solves the problem of xsi:type
> which can be used everywhere. For a "compiler", the "xsi:type" is a
> horror: for instance, where the schema specifies a long, it should
> expect any type which is derived from a long on that location!  And for
> an "any" it is of course much worse.  Gladly, only a few schema's do
> use it, nowadays.
>
> I have been thinking of some solution, where the application developer
> helps XML::Compile by creating a kind of manual substitionGroup. Something
> like:
>
>  xsistypes =3D>
>    { "{$ns}abstract" =3D>
>         [ "{$ns}ext1", "{$ns}ext2", ... ]
>
> As said: xsi:type is quite rare, nowadays.  So it las a low priority
> on the moment. There is a t/74type.t already, but waiting for the
> implementation.
> --
> Regards,
>
>               MarkOv
>
> ------------------------------------------------------------------------
>       Mark Overmeer MSc                                MARKOV Solutions
>        Mark at Overmeer.net                          solutions at overmeer.net
> http://Mark.Overmeer.net                   http://solutions.overmeer.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20091219/b1=
c7a5fb/attachment.htm


More information about the Xml-compile mailing list