[xsd-users] attribute name in error message

Boris Kolpackov boris at codesynthesis.com
Wed Oct 1 17:29:54 EDT 2008


Hi Ray,

Rizzuto, Raymond <Raymond.Rizzuto at sig.com> writes:

> std::auto_ptr<message> m1 = parse_message(sdmpMessage, xml_schema::flags::dont_initialize, props);

You may want to provide the document id (name) for diagnostics:

std::auto_ptr<message> m1 = parse_message(
  sdmpMessage, 
  "message.xml"
  xml_schema::flags::dont_initialize, 
  props);

Then the error will be:

message.xml:11:196 error: This type of attribute cannot have an empty value


> The error message displayed via the catch block is: ":11:196 error: This
> type of attribute cannot have an empty value"   Is there any way to get
> more detail from the exception, such as the name of the attribute?

Not at the moment. This error message is propagated from the Xerces-C++
validator so we will need to address it there. I've added it to the TODO
list and hopefully we will be able to fix this for the next release of 
Xerces-C++.

Boris




More information about the xsd-users mailing list