Herman
Well-known member
Hello,
I have a very old and badly written XML file, here is a sample of the data:
What I would like to do is take part of the "name" property value and put it in the "description" property instead (after the fact the name property should be "INI-001" and the description property should be "Initialisation de l'environnement de tests - MainProc"...). There are thousands of nodes like this I need to correct. I cannot change the format of the file, it has to stay exactly the same. How can I address that properly in vb.net? I'm having a hard time at even fetching the right node, as they are all called Node. How can I do a search through the XmlDocument taking into account the property "name" at every level?
I have a very old and badly written XML file, here is a sample of the data:
HTML:
<Nodes version="1">
<Node name="root">
<Node name="test data">
<Node name="child list">
<Node name="item0000000000">
<Node name="child list">
<Node name="item0000000000">
<Node name="child list"/>
<Node name="test parameters"/>
<Prp name="count" type="I" value="1"/>
<Prp name="description" type="S" value=""/>
<Prp name="enabled" type="B" value="0"/>
<Prp name="group" type="B" value="0"/>
<Prp name="index" type="I" value="0"/>
<Prp name="key" type="S" value="{4BDE1B33-B7C2-4C06-85D7-C6730F799CE2}"/>
<Prp name="name" type="S" value="INI-001 - Initialisation de l'environnement de tests - FinalProc"/>
<Prp name="stoponerror" type="I" value="0"/>
<Prp name="stoponexception" type="I" value="0"/>
<Prp name="test moniker" type="S" value="{36B361BE-E1C7-4C71-9285-47E36FAC9F6A}CloseApp"/>
<Prp name="timeout" type="I" value="0"/>
</Node>
</Node>
<Node name="test parameters"/>
<Prp name="count" type="I" value="1"/>
<Prp name="description" type="S" value=""/>
<Prp name="enabled" type="B" value="0"/>
<Prp name="group" type="B" value="0"/>
<Prp name="index" type="I" value="0"/>
<Prp name="key" type="S" value="{EF8B2E07-0724-43D1-A489-62193AB1D1DA}"/>
<Prp name="name" type="S" value="INI-001 - Initialisation de l'environnement de tests - MainProc"/>
<Prp name="stoponerror" type="I" value="0"/>
<Prp name="stoponexception" type="I" value="0"/>
<Prp name="test moniker" type="S" value="{36B361BE-E1C7-4C71-9285-47E36FAC9F6A}InitTestEnvironnement"/>
<Prp name="timeout" type="I" value="0"/>
</Node>
What I would like to do is take part of the "name" property value and put it in the "description" property instead (after the fact the name property should be "INI-001" and the description property should be "Initialisation de l'environnement de tests - MainProc"...). There are thousands of nodes like this I need to correct. I cannot change the format of the file, it has to stay exactly the same. How can I address that properly in vb.net? I'm having a hard time at even fetching the right node, as they are all called Node. How can I do a search through the XmlDocument taking into account the property "name" at every level?