[Dojo-Interest] XML To Table

lancer emotion 16 lancer.emotion at gmail.com
Thu Sep 14 13:57:22 MDT 2006


I just want to say i just figured out how to get the attribute.

If somebody sometime need this, in my example it will be like this :

tables[i].getAttribute("id")

Diego Carrion



On 9/14/06, lancer emotion 16 <lancer.emotion at gmail.com> wrote:
>
> Hi list, i tried to look for this myself but i couldnt find a solution.
>
> I have a xml file and a page with a table and a combo.
>
> The structure of the xml file is like this :
>
> <xml>
> <table id="a">
>     ...
> </table>
> <table id="b">
>     ....
> </table>
> <table id="c">
>     ...
> </table>
> <table id="d">
>     ....
> </table>
> </xml>
>
> The user can choose in the combo which table he wants to see (a,b,c or d).
>
> When he choose an option, i do this :
>
> dojo.io.bind({
>     url:"tables.xml",
>     handle:function(type, data, evt){
>         if(type=="load"){
>             setTable(data);
>         }else if(type=="error"){
>              ...
>         }
>     },
>     mimetype:"text/xml"
> });
>
> Then, in the setTable function i want to display the table which has the
> id selected in the combo. I have already this:
>
> function setChart(xml){
>     tables= xml.getElementsByTagName("table");
>     for(var i=0;i<tables.length;i++){
>         // i have a problem to get the attribute ID of the table node
>              // when i found the selected table, i have a problem to
> display it
>     }
> }
>
> Is there a way i can do this? Maybe there is and xml to html converter? Do
> i have to use the xlst transformer?
>
> Thanks in advance!
> --
> Diego Carrion
>



-- 
lancer emotion 16
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20060914/8c18e219/attachment.html


More information about the Dojo-interest mailing list