[xsd-users] copying IDREF elements classes

Omkar Wagh owagh at tower-research.com
Wed May 30 16:36:36 EDT 2012


Hey
I want to be able to copy IDREF structs.
So I have something like this :-

<xs:complexType name="some_unit">
<xs:sequence>
<xs:element name="some_ref" type="IDREF" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="some_bigger_unit">
<xs:sequence>
<xs:element name="unit1" type="some_unit" />
<xs:element name="unit2" type="some_unit" />
</xs:sequence>
</xs:complexType>

Now, I'm using xsd and cxx-tree and I want to be able to construct 
instances of class some_bigger_unit
from instances of class some_unit.
However, thanks to the auto_pointer thing, if I do that, the original 
class looses ownership of the pointer
to the referenced element (or so I believe). How do I work around this 
thing? Is there any way to use
standard pointers instead of auto_ptrs? Will simply detaching the root 
node work?

Alternatively, how do I copy elements that contain IDREF elements as 
children?

Omkar



More information about the xsd-users mailing list