Hi every one,
I am doing some R&D on xml editing.
I had one test enum and it has two enum values pen and pencil. I want to add a new element i.e node let us say scale.
class CreatingEnumThroughXml
{
// public static void main(Args _args)
// container strpath;
public static void main(Args _args)
{
str path;
//nodeXml = xDoc.createElement("scale")
XmlElement xmlName ,xmlAXEnumValue,XmlValue;
XmlNode enumValues , AXEnumValue,AxValue;
FileIoPermission permission;
permission = new
FileIoPermission("K:\AosService\PackagesLocalDirectory\HandelAndKontor\HandelAndKontor\AxEnum\TestEnum1.xml",'w');
XmlText xmlNameText,xmlValueText;
path = @"K:\AosService\PackagesLocalDirectory\mymodel\mymodel\AxEnum\TestEnum1.xml";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(path);
xmlName = xDoc.createElement("Name");
XmlValue = xDoc.createElement("Value");
xmlAXEnumValue = xDoc.createElement("AXEnumValue");
AXEnumValue = xDoc.documentElement().selectSingleNode("EnumValues").appendChild(xmlAXEnumValue);
// enumValues = xDoc.documentElement().selectSingleNode("EnumValues").appendChild(xmlName);
enumValues = AXEnumValue.appendChild(xmlName);
AxValue = AXEnumValue.appendChild(XmlValue);
xmlNameText = xDoc.createTextNode("Scale");
xmlValueText= xDoc.createTextNode("2");
enumValues.appendChild(xmlNameText);
AxValue.appendChild(xmlValueText);
xDoc.save(path);
}
}
For this new node is getting added to xml but it is not reflecting in the AOT.