Dart Language and XML package: reading nodes (text contents)



I have an XML file with the following structure:



<?xml version='1.0' encoding='UTF8'?>
<root>
<row filter="FILTER STRING"> // THIS IS THE FIRST "ROW"
<id>100</id>
<name>Some nome here</name>
<text>TEXT CONTENT HERE</text>
</row>
<row filter="FILTER STRING"> // THIS IS THE SECOND "ROW"
<id>101</id>
<name>Some nome here</name>
<text>TEXT CONTENT HERE</text>
</row>
</root>


I'll have lots of rows nodes in just one XML file and I cannot change this structure.


So, with XML package, how should I proceed in order to be able to get the text content from specific nodes?


For example, I would like to get the text from the node called "name" from the SECOND ROW.


No comments:

Post a Comment