Dobry den, mam fragment z XML, potrebuji pridat element metodou InsertBefore.
<poloha>
<profile>
<top>
<point x="0.0" y="0.0" />
<point x="0.0" y="0.0" />
</top>
<bottom>
<point x="0.0" y="0.0" />
<point x="0.0" y="0.0" />
</bottom>
</profile>
</poloha>
V kodu mam nasledujici pasaz:
Dim doc as XMLDocument
Dim cur As XmlNode
Dim novy As XmlNode
Dim point As XmlElement
Dim index as Integer
point = doc.SelectSingleNode("poloha/profile/top")
novy = doc.CreateNode(XmlNodeType.Element, "point", " ")
cur = point.InsertBefore(novy, point.ChildNodes.Item(index))
Po spusteni se uzel prida na spravne misto ale ve tvaru:
<point xmlns=" " /> Poradte co s tim, neni mi jasny 3.parametr noveho uzlu. Dekuji
|