[xsd-users] Report line number when error is encountered

Alessandro Carpi alessandro.carpi at gmail.com
Tue Mar 1 15:05:30 EST 2011


Hi,
I am very happy to use XSD C++/Parser for a personal project in which
actually I'm involved.

I have a simple question: is there a way to raise an XML exception when a
particular condition was encountered during the parsing of a file?

Specifically, I have a language that internally uses bison to parse an
expression, something like this:

<if expr="a>b">
 <if-true>
   [stuff]
 </if-true>
 <if-false>
   [other-stuff]
 </if-false>
</if>
Obviously expressions should be written according to a specific grammar
defined by the external bison parser. Actually I can recognize the event
into the code which parses the attribute "expr" (the bison parser returns a
null pointer).

It would nice if, when this kind of errors are encountered (aka. expression
parser returns a null pointer because is written wrongly) , the XML parser
prints the XML line of the wrong expression.

Thank you very much.

--
Alessandro


More information about the xsd-users mailing list