Hi community I have the following problem,
given this xml
<test>
<comp>
<id>1</id>
<content>bar</content>
</comp>
<comp>
<id>2</id>
<content>foo</content>
</comp>
</test>
I want to change the value of the content of the comp element with id 2. Therefore I loop with a foreach loop
for each (var x : XML in testXML.children()) {
if (x.id == 2) {
for each (var element : XML in x.Children()) {
if (element.localName() == "content") {
element = "new content";
}
}
}
}
now when reaching the point element = "new content";
my programm tells me I cannot give element the value new content as this is a string and element is xml. How can I achieve this?
Thanks in advance
Sebastian