How to retrieve a attribute from XML?

  • Thread starter =?iso-8859-1?q?F=E9rnas_-_Brasil?=
  • 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
 
C

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!
********************************************
 
C

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top