How to retrieve a attribute from XML?

  • Thread starter Thread starter =?iso-8859-1?q?F=E9rnas_-_Brasil?=
  • Start date Start date
?

=?iso-8859-1?q?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
 
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!
********************************************
 
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
 
Back
Top