[xsd-users] --custom-type-regex bug

Zoltan Szatmary zszatmary at gmail.com
Fri Sep 25 17:01:30 EDT 2009


Dear Developers,

it seems to me, that --custom-type-regex does not work as expected
when generating C++/Tree. An option given to xsd.exe in the form of

--custom-type-regex /Foo(.*)/Bar\1/

yields typedefs explicitly defining a 'Bar\1' type every time a type
name starting with 'Foo' in the XSD is matched. I suspect that the
cause of this behavior is at the lines 401 and 454 in file
{$src_root}\xsd-3.2.0-1\xsd\cxx\tree\elements.cxx

Instead of

          r = i->pat.merge (name, i->type_sub);

and

            r = i->pat.merge (name, i->base_sub);

there should be

          r = i->pat.merge (i->type_sub, name);

and

            r = i->pat.merge (i->base_sub, name);

respectively.

I may be wrong though, in which case I apologize and ask you for
advice on how to use --custom-type-regex properly.
Environment: Windows XP, VC++ 8.0, CodeSynthesis XSD 3.2

yours,

Zoltan Szatmary-Ban




More information about the xsd-users mailing list