[xsd-users] Problem with duplicate Ids

Boris Kolpackov boris at codesynthesis.com
Fri Dec 23 10:46:08 EST 2005


Mark,

BURGESS, Mark, FM <Mark.BURGESS at rbos.com> writes:

> I am trying to insert an ExecutionEnvironment with id =
> "ExecutionEnvironment:2" and an  ExecutionOperation with id =
> "ExecutionOperation:3" and ExecutionEnvironmentRef =
> "ExecutionEnvironment:2" into an ExecutionObjects but it throws a
> xsd::cxx::tree::duplicate_id<char> exception and no one here can figure out
> why.

The duplicate_id exception is thrown if you try to insert a duplicate
ID into a document tree. XML Schema requires IDs to be unique in the
context of a document.

I looked at you code and I can't see right away where the duplication
could happen (though note that it differs from what you described above,
e.g., I don't see where you pass "ExecutionOperation:3"). I also cannot
build and debug your code since it is not complete. What I suggest you
do is catch this exception and print the ID that is causing the problem.
This will hopefully give you some hints. If you still can't find the reason,
it would be helpful if you could create a minimal example that reproduces
the problem.


> const ares::ExecutionEnvironment::_xsd_MarketDataContext::type_

BTW, you should use ares::ExecutionEnvironment::MarketDataContext::type
instead of the above. All names that start with _xsd_ are for internal
use and may change in a backwards-incompatible manner. This is also
described in the manual:

http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/

See Section 2.8, "Mapping for Local Elements and Attributes".


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20051223/800bfdbb/attachment.pgp


More information about the xsd-users mailing list