Get specific elemtent from xml file



Let's say i have two xml files. Both contain a specific element (let's say "name") but one has the element on a different position than the other xml file.


ex:


first xml-file:



<root>
<element1>text1</element1>
<element2>
<name value="firstname">John</name>
<element2>
</root>


second xml-file:



<root>
<element1>text1</element1>
<name value="firstname">Michael</name>
<element2>text2</element2>
</root>


what is the most runtime-efficient way to get this elements without knowing their position before?


(Sorry if there is already an answer on stackoverflow but I didn't find one)


No comments:

Post a Comment