0
löschen Tag New
und dessen Inhalt, wenn der nächste Tag <b>
C# Linq zu xml, löschen Namensschild basierend auf nächsten Tag
hier ist meine XML-Datei
<tag>
<New>some content</New>
<b> bold </b>
<New> content two </New>
<p> p tag </p>
</tag>
Ausgang ist
<tag>
<b> bold </b>
<New> content two </New>
<p> p tag </p>
</tag>
Hier ist mein Code
XElement rootImg = XElement.Parse(xml string variable);
IEnumerable<XElement> img =
from el in rootImg.Descendants("New").ToList()
select el;
foreach (XElement el in img)
{
//what am i going to do here?
}
Entschuldigung für Noob. aber wie kann ich deinen Code verwenden? – codequery18
Fügen Sie es für Sie foreach hinzu – Raskayu