Re: [Erlyaws-list] Problems with ehtml

 Re: [Erlyaws-list] Problems with ehtml From: Dominique Boucher - 2008-05-14 18:46:43 ```I would do something like the following (assuming that the 'data' records always have a fixed length): out(A) -> Rows = [{data, 1, "A1", "A2"}, {data, 2, "B1", "B2"}, {data, 3, "C1", "C2"} ], {ehtml, lists:map(fun ({data, Num, Val1, Val2}) -> {p, [], {ul, [], [{li, [], integer_to_list(Num)}, {li, [], Val1}, {li, [], Val2}]}} end, Rows)}. Dominique out(A) -> Rows = [{data, 1, "A1", "A2"}, {data, 2, "B1", "B2"}, {data, 3, "C1", "C2"} ], {ehtml, lists:map(fun ({data, Num, Val1, Val2}) -> {p, [], {ul, [], [{li, [], integer_to_list(Num)}, {li, [], Val1}, {li, [], Val2}]}} end, Rows)}. > From: erlyaws-list-bounces@... [mailto:erlyaws-list- > bounces@...] On Behalf Of Jilani Khaldi > Sent: May 14, 2008 2:11 PM > To: YAWS ML > Subject: [Erlyaws-list] Problems with ehtml > > Hi All, > I have this code but I can't get the correct output in any way. > > out(A) > Rows=mydb:select_all(), > % Rows is a list and it has the following tructure: > % [{data, 1, "A1", "B1"}, {data, 2, "A2", "B2"}, > % .., {data, n, "An", "Bn"}]. > ... > > The desired output is the following: >

>

>
• 1
• >
• A1
• >
• B1
• >
>

>

>

>
• 2
• >
• A2
• >
• B2
• >
>

> ... >

>

>
• n
• >
• An
• >
• Bn
• >
>

> > Any hint? > Thank you. > > //JK > > > ----------------------------------------------------------------------- > -- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Erlyaws-list mailing list > Erlyaws-list@... > https://lists.sourceforge.net/lists/listinfo/erlyaws-list ```

 [Erlyaws-list] Problems with ehtml From: Jilani Khaldi - 2008-05-14 18:19:12 ```Hi All, I have this code but I can't get the correct output in any way. out(A) Rows=mydb:select_all(), % Rows is a list and it has the following tructure: % [{data, 1, "A1", "B1"}, {data, 2, "A2", "B2"}, % .., {data, n, "An", "Bn"}]. ... The desired output is the following:

• 1
• A1
• B1

• 2
• A2
• B2

...

• n
• An
• Bn

Any hint? Thank you. //JK ```
 Re: [Erlyaws-list] Problems with ehtml From: Dominique Boucher - 2008-05-14 18:46:43 ```I would do something like the following (assuming that the 'data' records always have a fixed length): out(A) -> Rows = [{data, 1, "A1", "A2"}, {data, 2, "B1", "B2"}, {data, 3, "C1", "C2"} ], {ehtml, lists:map(fun ({data, Num, Val1, Val2}) -> {p, [], {ul, [], [{li, [], integer_to_list(Num)}, {li, [], Val1}, {li, [], Val2}]}} end, Rows)}. Dominique out(A) -> Rows = [{data, 1, "A1", "A2"}, {data, 2, "B1", "B2"}, {data, 3, "C1", "C2"} ], {ehtml, lists:map(fun ({data, Num, Val1, Val2}) -> {p, [], {ul, [], [{li, [], integer_to_list(Num)}, {li, [], Val1}, {li, [], Val2}]}} end, Rows)}. > From: erlyaws-list-bounces@... [mailto:erlyaws-list- > bounces@...] On Behalf Of Jilani Khaldi > Sent: May 14, 2008 2:11 PM > To: YAWS ML > Subject: [Erlyaws-list] Problems with ehtml > > Hi All, > I have this code but I can't get the correct output in any way. > > out(A) > Rows=mydb:select_all(), > % Rows is a list and it has the following tructure: > % [{data, 1, "A1", "B1"}, {data, 2, "A2", "B2"}, > % .., {data, n, "An", "Bn"}]. > ... > > The desired output is the following: >

>

>
• 1
• >
• A1
• >
• B1
• >
>

>

>

>
• 2
• >
• A2
• >
• B2
• >
>

> ... >

>

>
• n
• >
• An
• >
• Bn
• >
>

> > Any hint? > Thank you. > > //JK > > > ----------------------------------------------------------------------- > -- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Erlyaws-list mailing list > Erlyaws-list@... > https://lists.sourceforge.net/lists/listinfo/erlyaws-list ```