[xsd-users] sequence copy and xsd:IDREF

Sumant Tambe sutambe at dre.vanderbilt.edu
Wed Oct 29 16:22:02 EDT 2008


Hi,

I'm getting a seg-fault while trying to access xsd:IDREF attribute in a 
*copy* of a sequence. For instance, in the library catalog example, 
"recommends" is an xsd:IDREF attribute. The following code seg-faults 
when b is a copy but works fine when it is a reference.

std::auto_ptr<catalog> c (catalog_ (argv[1]));
catalog::book_sequence b = c->book();

for (catalog::book_const_iterator bi (b.begin ());
      bi != b.end (); ++bi)
{
   if (ai->recommends ())
      cerr << "  Recommends : " << (*ai->recommends ())->title ();
}

Why is such a difference in the behavior?

Thanks,

Sumant.




More information about the xsd-users mailing list