|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to retrieve a attribute from XML?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. -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com ******************************************** Think outside the box! ******************************************** "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 > 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 > |
|||||||||||||||||||||||