Dictionary
Dictionary<XElement, XElement> _XParents = new Dictionary<XElement, XElement>();
My dictionary looks like:(in general)
key:<node>, value: <parentnode>
in my case:
Key: <Branch1>
<Child1 />
<Child3 />
</Branch1>, Value: <Root>
<Branch1>
<Child1 />
<Child3 />
</Branch1>
<Branch2 />
</Root>
Key: <Child1 />, Value: <Branch1>
<Child1 />
<Child3 />
</Branch1>
Key: <Child3 />, Value: <Branch1>
<Child1 />
<Child3 />
</Branch1>
Key: <Branch2 />, Value: <Root>
<Branch1>
<Child1 />
<Child3 />
</Branch1>
<Branch2 />
</Root>
My XML looks like:
<Root>
<Branch1>
<Child1/>
<Child2/>
</Branch1>
<Branch2>
</Root>
I have tried this, which is adding the node at the end but i do not
know how to add it at the specific place:
abc = new XElement("Child3");
pqr = new XElement("Branch1", new XElement("Child1",),
new XElement("Child2"));
_XParents.Add(abc,pqr);
question from:
https://stackoverflow.com/questions/66052251/how-to-add-the-node-at-the-specific-place-of-the-dictionaryxelement-xelement-i 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…