[xsd-users] attribute name in error message

Rizzuto, Raymond Raymond.Rizzuto at sig.com
Thu Oct 2 09:16:29 EDT 2008


Boris,

Thanks for the suggestion.  I don't really have a document since I'm parsing an in-memory string created from serializing an XML object.  But I may be able to pass a string describing with the message name to help with diagnosing the issue.

I appreciate your adding a TODO item to have Xerces-C++ provide that information.  I think that would be very helpful, in general.

Ray


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Wednesday, October 01, 2008 5:30 PM
To: Rizzuto, Raymond
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] attribute name in error message

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

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.




More information about the xsd-users mailing list