[xsd-users] Get tag name of a generated type

Yury Zaytsev yury.zaytsev at traveltainment.de
Mon Apr 27 07:42:58 EDT 2015


Hi,

I'm wondering what's the easiest / recommended way of finding out the tag 
name corresponding to the C++/Tree type?

I can see that the tag name is hard-coded in the generated code for 
parsing and serialization, but it doesn't seem to be available for 
external use through any kind of public interface.

I imagine that the generator could encode it as a static constexpr char* 
class member with a public getter and use its symbolic name for parsing 
and serialization. Could this possibly the added to XSD, or this is a bad 
idea for reasons that I have overlooked?

In any case, what would be the easiest way to get it as it stands?

All I can think of right now is to create a dummy containing element, 
serialize a dummy child element to DOM and do something like that on it:

     const ::xsd::cxx::xml::qualified_name< char > n (
       ::xsd::cxx::xml::dom::name< char > (e));

but this doesn't really look like a an elegant solution...

All the best,

-- 
Dr. Yury V. Zaytsev
Senior Software Developer
IT Data Production

TravelTainment GmbH
Carlo-Schmid-Straße 12
52146 Würselen/Aachen, Germany
yury.zaytsev at traveltainment.de

http://www.traveltainment.de

Amtsgericht Aachen, HRB 15873
Geschäftsführer: Bernhard Steffens (Vorsitzender),
Dr. Oliver Rengelshausen



More information about the xsd-users mailing list