简体   繁体   中英

How can I make edits to a single xml node in android

I need a fast way to save edits to an xml file any examples would be greatly appreciated I assume this would be using xpath? thanks

[EDIT] I am currently using documentBuilder.parse() but that takes far too long, approximately 20 seconds to read the file

I can give you example in QT..I don't know in what language are you working with. Here is for QT:

QDomDocument doc("MyML");
 QDomElement root = doc.createElement("MyML");
 doc.appendChild(root);

 QDomElement tag = doc.createElement("Greeting");
 root.appendChild(tag);

 QDomText t = doc.createTextNode("Hello World");
 tag.appendChild(t);

 QString xml = doc.toString();

If I didn't get you right please respond. And maybe we can sort it out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM