Problem exporting content with XMERL

Bertil Karlsson bertil.karlsson@REDACTED
Tue May 2 15:41:59 CEST 2006


Hi,

First, you have to pass the structure as a list:
xmerl:export_simple([dvbh_xml:simple()], xmerl_xml, [{title, "Doc 
Title"}]).

Second, when I ran your example with modified input I hit another error, 
which is a bug in xmerl.
Maybe I'll manage to deliver this bug-fix with R11.

/Bertil

karol skocik wrote:
> Hi,
>  I am trying to export content, but XMERL dies with error. The
> content looks like this :
>
> simple() ->
>    {document, [{title, "Doc Title"}, {author, "Ulf Wiger"}],
>     [{section, [{heading, "heading1"}],
>       [{'P', "This is a paragraph of text."},
>        {section, [{heading, "heading2"}],
>         [{'P', "This is another paragraph."},
>          {table, [{border, 1}],
>           [{heading,
>             [{col, "head1"},
>           {col, "head2"}]},
>            {row,
>             [{col, "col11"},
>              {col, "col12"}]},
>            {row,
>             [{col, "col21"},
>              {col, "col22"}]}]}]}]}]}.
>
> -- it is the same content as used in Ulf's presentation.
>
> Next, I am doing the same as in presentation :
>
> xmerl:export_simple(dvbh_xml:simple(), xmerl_xml, [{title, "Doc 
> Title"}]).
> but there is a problem.
>
> The whole session looks like this:
>
> (ipe@REDACTED)13> dvbh_xml:simple().
> {document,[{title,"Doc Title"},{author,"Ulf Wiger"}],
>          [{section,[{heading,"heading1"}],
>                    [{'P',"This is a paragraph of text."},
>                     {section,[{heading,"heading2"}],
>                              [{'P',"This is another paragraph."},
>                               {table,[{border,1}],
>                                      
> [{heading,[{col,"head1"},{col,"head2"}]},
>                                       
> {row,[{col,"col11"},{col,"col12"}]},
>                                       
> {row,[{col,"col21"},{col|...}]}]}]}]}]}
> (ipe@REDACTED)14> xmerl:export_simple(dvbh_xml:simple(), xmerl_xml,
> [{title, "Doc Title"}]).
>
> =ERROR REPORT==== 2-May-2006::10:32:28 ===
> Error in process <0.289.0> on node 'ipe@REDACTED' with exit value:
> {function_clause,[{xmerl_lib,expand_content,[{document,[{title,"Doc
> Title"},{author,"Ulf
> Wiger"}],[{section,[{heading,"heading1"}],[{'P',"This is a paragraph
> of text."},{section,[{heading,"heading2"}],[{'P',"This is anothe...
>
> ** exited: {function_clause,[{xmerl_lib,
>                                 expand_content,
>                                 [{document,
>                                      [{title,"Doc Title"},
>                                       {author,"Ulf Wiger"}],
>                                      [{section,
>                                           [{heading,"heading1"}],
>                                           [{'P',
>                                                "This is a paragraph of 
> text."},
>                                            {section,
>                                                [{heading,"heading2"}],
>                                                [{'P',
>                                                     "This is another
> paragraph."},
>                                                 {table,
>                                                     [{...}],
>                                                     [...]}]}]}]},
>                                  1,
>                                  [],
>                                  false]},
>                             {xmerl,export_simple1,3},
>                             {erl_eval,do_apply,5},
>                             {shell,exprs,6},
>                             {shell,eval_loop,3}]} **
>
> Does anybody know what is the problem? I am using latest Erlang on 
> Linux/x86.
>
> Karol



More information about the erlang-questions mailing list