xmerl usage question

Chandrashekhar Mullaparthi <>
Wed Apr 14 11:16:53 CEST 2004


Hi all,

I'm trying to specify my own ETS table when using xmerl for parsing as 
follows. But the request fails the second time as below.

7> FetchFun = fun(_, State) -> {ok, {string, Dtd}, State} end.
#Fun<erl_eval.11.1870983>

19> xmerl_scan:string(Xml, [{fetch_fun, FetchFun}, {rules, myrules}]).
{{xmlElement,'MyRequest',
              [],
              1,
              [],
              [{xmlText,[{'MyRequest',1}],1,[],"\n"},
               {xmlElement,'Elem1',
                           [{'MyRequest',1}],
                           2,
                           [],
                           
[{xmlText,[{'Elem1',2},{'MyRequest',1}],1,[],"abcd"}],
                           [],
                           'Elem1',
                           [],
                           {xmlNamespace,[],[]}},
               {xmlText,[{'MyRequest',1}],3,[],"\n"},
               {xmlElement,'Elem2',
                           [{'MyRequest',1}],
                           4,
                           [],
                           
[{xmlText,[{'Elem2',4},{'MyRequest',1}],1,[],"abcd"}],
                           [],
                           'Elem2',
                           [],
                           {xmlNamespace,[],[]}},
               {xmlText,[{'MyRequest',1}],5,[],"\n"}],
              [],
              'MyRequest',
              [],
              {xmlNamespace,[],[]}},
  "\n"}
20> xmerl_scan:string(Xml, [{fetch_fun, FetchFun}, {rules, myrules}]).
871- fatal: {already_defined,'MyRequest'}
** exited: {fatal,{{already_defined,'MyRequest'},2,20}} **

Is there any way around this?? I see where this is happening, but I 
don't understand why xmerl flags this as an error. any help much 
appreciated.

thanks,
Chandru




More information about the erlang-questions mailing list