public void ModifyXML(string inputAsset, string test, string version)
{
File.Create(Constants.XMLDoc).Close();
XmlReader xReader = XmlReader.Create(xmlDoc);
while (!xReader.EOF)
{
if (xReader.Name != "Asset")
{
xReader.ReadToFollowing("Asset");
}
//If we have not reached the end of the file
if (!xReader.EOF)
{
XElement asset = (XElement)XElement.ReadFrom(xReader);
string branchName = (string)asset.Attribute("Name");
if (branchName == inputAsset)
{
}
}
}
}
Hello guys so I'm currently trying to edit an XML Doc whenevr my inputs are not null in my main. My XML looks like this:
<Properties>
<Assets>
<Asset Name="" Version="">
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
</Asset>
<Asset Name="" Version="">
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
<TestCase Name="" Version="" SubVersion="" />
</Asset>
</Assets>
</Properties>
So the kinds of edits that are possible are like changes of a current test case s ofor example the version value or sub version or name or even adding a new test case to an asset or adding a completely new asset if need be. How would I go about this?
Use the code I posted on previous posting. How large is you xml input? The answer would be different fro small xml than large xml. What inputs do you plan to use for the modifications.