[xsd-users] naming conflict

Boris Kolpackov boris at codesynthesis.com
Thu Dec 20 07:04:54 EST 2007


Hi Nicholas,

Nicholas Xu <xunich at gmail.com> writes:

> I met a problem when I work with xsd generated codes. I have a schema
> which contains a recursion, let's say, a 'list' element contains a
> sequence of 'list's. XSD generates a listType class which has several
> list methods (setter and getter), at the same time, another class
> 'list' which inherits the listType.

My understanding of the problem from your description above is as
follows:

struct base
{
  void list ();
};

struct list: base
{
};

void f ()
{
  list l;
  l.list (); // error
}


> Is there a way to change the name convention of generated methods, or
> is there a C++ trick to solve the problem?

The C++ trick to resolve the above error is this:

l.base::list ();

That is, you need to qualify the 'list' name.

As for the naming convention, there will be a way to change it in the
next release. If you would like, you can also try it now with pre-
release binaries which are available for Windows and GNU/Linux:

http://codesynthesis.com/~boris/tmp/xsd-3.1.0.a5-i686-windows.zip
http://codesynthesis.com/~boris/tmp/xsd-3.1.0.a5-i686-linux-gnu.tar.bz2

For the naming convention options, see the NEWS file in the above
distributions.

Boris




More information about the xsd-users mailing list