[xsd-users] Element names from exceptions

Darren Garvey darren.garvey at gmail.com
Mon Feb 14 07:21:26 EST 2011


Hi,

I am currently trying to produce some user-friendly error messages by
extracting information from the exceptions thrown by C++/Tree parsing.

The actual error descriptions are quite nice in most cases and I can pass
them on directly. However, while the line / column numbers are useful when
debugging problem, they're indecipherable to users, who don't see XML at all
but a user interface. I was hoping to get information about the element
being parsed without having to dig back into the XML using the line / column
info.

For instance, when an empty element is found that is expected to be a
number, you get: "error: value '' does not match regular expression facet
'[+\-]?[0-9]+'".

Is there some means of getting the context of the error, eg. the element
name that was being parsed?

Thanks in advance,
Darren


More information about the xsd-users mailing list