D
DBC User
Hi,
I have an xml and I am able to use xpath to identify each node that
statisfy the selection criteria. I got the node list. I would like to
know is it possible to do the following for the following XML
<Files>
<Application key="one">
<Version>1</Version>
<Age>120</Age>
</Application>
</Files>
I have lot of application and I want to find out only the ones with
'one' I got that working got the nodelist. Inside the iterator, I want
to get the values of Version and age and assign it to a class. But I do
not want to hard code something like
myClass.Version = node.ChildNodes[0].InnerText;
myClass.Age = node.ChildNodes[1].InnerText;
it works, but I would like to get it based on a element name, that
gives me the flexibility incase some adds a element in between version
or age. Or they rearrange the xml node itself.
Hope I am clear. Please let me know how can I do this in the best
possible approach? (I was thinking of applying XPath on each node to
get it, just worried the performance and resource)
Thanks.
I have an xml and I am able to use xpath to identify each node that
statisfy the selection criteria. I got the node list. I would like to
know is it possible to do the following for the following XML
<Files>
<Application key="one">
<Version>1</Version>
<Age>120</Age>
</Application>
</Files>
I have lot of application and I want to find out only the ones with
'one' I got that working got the nodelist. Inside the iterator, I want
to get the values of Version and age and assign it to a class. But I do
not want to hard code something like
myClass.Version = node.ChildNodes[0].InnerText;
myClass.Age = node.ChildNodes[1].InnerText;
it works, but I would like to get it based on a element name, that
gives me the flexibility incase some adds a element in between version
or age. Or they rearrange the xml node itself.
Hope I am clear. Please let me know how can I do this in the best
possible approach? (I was thinking of applying XPath on each node to
get it, just worried the performance and resource)
Thanks.