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

Yury Zaytsev yury.zaytsev at traveltainment.de
Tue Apr 28 11:05:52 EDT 2015


Hi Boris,

On Tue, 28 Apr 2015, Boris Kolpackov wrote:

> There could be no such way since an (XML Schema) type can be used to
> classify several elements (and even attributes). Which element name
> do you want returned?

Thank you very much for the explanation! Now I understand the problem a 
bit better: in my schemas, many types correspond to single elements, so I 
have overlooked this issue.

> Some things that you may find relevant:
>
> 1. DOM Assocication.
> 2. Element types (see the 'messaging' example).

These pointers are highly appreciated, it solves the problem when parsing.

The motivation for my original question, however, was as follows: I'm 
using streaming to serialize a large number of child elements of a parent 
element, and for now I had to hardcode the element names for s.next() 
calls. So, I thought that it would be great if I could get this 
information from the types instead.

It seems that I should just keep on using hardcoded values though, as 
there is no easy way around it :-/

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