[erlang-questions] Xmerl question

Rodolphe Quiédeville rodolphe@REDACTED
Mon Oct 21 11:47:57 CEST 2013


Lars Thorsen <lars.thorsen@REDACTED> writes:

> Hi,
> try to use xmerl_sax_parser:file/2 instead, it should get you a better line number.
> It works better than xmerl_scan for parsing as long as you don't need to validate
> against a schema or DTD (the validation part is not ready yet).

Hi Lars,

Thanks a lot, it's perfect, xmerl_sax_parser:file/2 does what I'm
looking for, as it prints the error on stdout like :

Config Error, aborting ! {{badmatch,
                              {<<"<transaction name=\"num\">\n
                              <request subst=\"true\"> \n        <http
                              url=\"/number?num=%%_number%%\"
                              method=\"GET\" version=\"1.1\" ></http>\n
                              </request>\n\n      <if var=\"number\"
                              eq=\"8\">\n        <request
                              subst=\"true\"> \n          <!-- not
                              closed -->\n          <http
                              url=\"/ok-number?num=%%_number%%\"
                              method=\"GET\" version=\"1.1\" >\n
                              </request>\n      </if>\n\n    </transaction>">>,

It'll help a lot to debug.

Regards,

-- 
Rodolphe Quiédeville
Expert Tsung - Consulting en performance des SI
Tel : 06 13 79 63 41
http://blog.rodolphe.quiedeville.org



More information about the erlang-questions mailing list