Home > Back-end >  Manipulating XML: how to directly replace IXmlnode. XML?
Manipulating XML: how to directly replace IXmlnode. XML?

Time:09-20

XML is typically create xmlnode operation, add, modify, delete node content,
But XML as plain text, IXMLNode. XML as a read-only property, how to replace the XML directly, realize the IXMLNode load, modify?

CodePudding user response:

XML is a text file,
Read only work a little bit more simple, only write XML modify XML complex,
Must first understand its structure, and by reading the nodes, then modify the node value, finally will write XML node,

CodePudding user response:

????????????????????

CodePudding user response:

A lazy originally wanted to find ready-made methods to realize the IXMLNode. The XML update, not found, had trouble myself,
IXMLNode XML, NodeName is read-only attribute, including to update node name, so I did:
Goal: I have some nodes in XML is stored in a text file, need to be updated to the current node,
Methods: to load the XML node is update the content, including the node name,
Implementation: to record the location of the original node (NodeIndex), delete it. (use formatXMLData after parsing the text of the node name) (Nodeindex) to create a new node in the position, from the text analyze the node properties and child nodes and recreate the completion,

CodePudding user response:

Must first find out XML structure, can read and write it,
The XML file, sent to me, [email protected]
  • Related