Home All Groups Group Topic Archive Search About

How to retrieve a attribute from XML?

Author
5 Dec 2006 10:12 AM
F=E9rnas_-_Brasil
Hey guys,

imagine the following XML:

<configuracoes>
    <tabela nomeXML="aaa" nomeBD="bbb">
        <ligacao>
            <campoOrigem>ccc</campoOrigem>
            <campoDestino>ddd</campoDestino>
        </ligacao>
    </tabela>
</configuracoes>

how could I retrieve the values "aaa" or "bbb" of the attributes of the
tabela node, using a DataSet when reading this XML...

thanks

Author
5 Dec 2006 4:09 PM
Cowboy (Gregory A. Beamer)
If the node has attributes, you can set the node and then query the
attributes collection. You can do this by finding all nodes of a particular
type (tabela, for example) and then parsing its children elements.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
Show quote
"Férnas - Brasil" <garb***@wideweb.com.br> wrote in message
news:1165313577.574564.324230@80g2000cwy.googlegroups.com...
> Hey guys,
>
> imagine the following XML:
>
> <configuracoes>
> <tabela nomeXML="aaa" nomeBD="bbb">
> <ligacao>
> <campoOrigem>ccc</campoOrigem>
> <campoDestino>ddd</campoDestino>
> </ligacao>
> </tabela>
> </configuracoes>
>
> how could I retrieve the values "aaa" or "bbb" of the attributes of the
> tabela node, using a DataSet when reading this XML...
>
> thanks
>
Author
6 Dec 2006 6:08 AM
Cor Ligthert [MVP]
Fernas,

If you use a xml document file (as this is) in a dataset, than the
attributes will be converted to childtables with elements and relations.

I hope this helps,

Cor

Show quote
"Férnas - Brasil" <garb***@wideweb.com.br> schreef in bericht
news:1165313577.574564.324230@80g2000cwy.googlegroups.com...
> Hey guys,
>
> imagine the following XML:
>
> <configuracoes>
> <tabela nomeXML="aaa" nomeBD="bbb">
> <ligacao>
> <campoOrigem>ccc</campoOrigem>
> <campoDestino>ddd</campoDestino>
> </ligacao>
> </tabela>
> </configuracoes>
>
> how could I retrieve the values "aaa" or "bbb" of the attributes of the
> tabela node, using a DataSet when reading this XML...
>
> thanks
>

AddThis Social Bookmark Button