xmerl - \n\r

Sanjaya Vitharana <>
Fri Jun 23 15:02:26 CEST 2006


Hi

Error:
19> xmerl_scan:file('f1.xml',[{validation,true}]).
1007- fatal: {invalid_target_name," version=\""}
** exited: {fatal,{{invalid_target_name," version=\""},
                   {file,'f1.xml'},
                   {line,2},
                   {col,6}}} **
20> 

Reason: "escape characters" (\n\r) or "Space" in the beginning of file as below.

\r\n
<?xml version="1.0"?><!DOCTYPE IVR SYSTEM "./ivr.dtd">
<IVR>
  <content type="file" filename="D:\\voicefilestest\\vsms\menu\Erecorded.vox">Your message has been recorded.</content>
  <content type="file" filename="D:\\voicefilestest\\vsms\menu\Epreesendlistenrecord.vox">Press 1 to send the message, press 2 to listen to the message, or press 3 to record the message again.</content>
    <key no="1">http://172.22.6.28:8080/vsms/send/index.jsp</key>
    <key no="2">http://172.22.6.28:8080/vsms/send/index.jsp</key>
    <key no="3">http://172.22.6.28:8080/vsms/send/index.jsp</key>
<session>773215936&vw=ssendmenu&cli=773215936&date=200606231726796&serv=777331370&id=99&filename=777331370200606231726796.vox&lang=E&starttime=1151061961&frm=null&msgBox=null&fileNo=null</session>
</IVR>

Question:
1.) <?xml version="1.0"?> -- must be in the staring point of a xml file ???
2.) how to avoid such situation ??? (without checking all xml files). Are there any way to tell parser to avoid those characters ???

Thanks in advance

Sanjaya Vitharana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060623/c438dae1/attachment.html>


More information about the erlang-questions mailing list