[xsd-users] how to access xs:ref="element" target element name

Boris Kolpackov boris at codesynthesis.com
Tue Aug 28 08:27:16 EDT 2012


Hi Vikas,

vikas <pvssvikas at gmail.com> writes:

> In my case we have more number of derived types, so we are maintaining
> internal map of derived handler objects versus element names, so that xsd
> derived object can be interpreted by appropriate handler function.

If you have one-to-one mapping between derived types and element names,
then you could instead have a map of std::type_info to handler functions.
This will be faster than comparing strings (element names) and you won't
need to maintain the DOM association.


> I was able to get the xml element node name when "keep_dom" flag is used.
> can you please help me with information, on when to use NodeName & when to
> use LocalName methods?

See the Xerces-C++ documentation.


> In case of keep_dom usage do i need to take care of any special object
> destruction? or is it fine if I can rely on auto_ptr?

Again, refer to the documentation. Specifically, Section 5.1, "DOM
Association".

Boris



More information about the xsd-users mailing list