[erlang-questions] Xmerl question

Lars Thorsen lars.thorsen@REDACTED
Mon Oct 21 10:44:13 CEST 2013


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).

Regards Lars
OTP Team

On 10/09/2013 05:07 PM, Rodolphe Quiédeville wrote:
> Hi,
>
> This is my first post on this list, I a beginner on erlang with a long
> experience in other languages like python or perl.
>
> When using a xml file with syntax error with xmerl_scan:file the output
> indicate the line and column number as :
>
> 1>  xmerl_scan:file('failed.xml').
> 2542- fatal: {endtag_does_not_match,{was,request,should_have_been,http}}
> ** exception exit: {fatal,{{endtag_does_not_match,{was,request,
>                                                     should_have_been,http}},
>                             {file,'failed.xml'},
>                             {line,77},
>                             {col,8}}}
>
> The problem is the file failed.xml is composed with a lot of ENTITY so
> the original file doesn't contains 77 lines, the debug is not easy is
> this case. Howto dump the final xml really analyzed by xmerl_scan to
> debug the xml ?
>
> Is there any options to pass to xmerl_scan ? I read the doc but can't
> find the solution. Any helps appreciate
>
> Regards;
>
> PS : the question was already post on stackoverflow as
> http://stackoverflow.com/questions/19213242/
>





More information about the erlang-questions mailing list