[xsd-users] Possibility to resolve all idref inside a document

Boris Kolpackov boris at codesynthesis.com
Wed Nov 26 03:32:34 EST 2008


Hi Jan,

Jan Klimke <jan.klimke at hpi.uni-potsdam.de> writes:

> i am currently asking myself whether it is possible to resolve all
> exisitng IdRefs inside a document and replace the elements with the
> referenced objects (or at least c++ references to them)?

The idref instances in the object model act like smart pointers, so
you already can get references to the objects they are referred to.
By default, the referred to object is returned as xml_schema::type
and you will need to cast it to the concrete type. There is also an
extension to XML Schema which allows you to specify the type for 
idref and gives you a statically-typed smart pointer. See the
library example on how to do that.

There is no automatic way to replace idref instances with the objects
they are referring to (I also don't think many people would want to do
that) though you can probably achieve this with type customization.

Boris




More information about the xsd-users mailing list