estanisgeyer
27th January 2009, 20:10
Hi guys,
I have an xml document and I need copy part of the content to a new xml document, following an example:
<?xml encoding="utf-8" ?>
<Library>
<Location>
<Test> <---- split here
.....
.....
</Test>
<Test2>
.....
.....
</Test2>
<Location>
</Library>
I want to create a new document xml taking the "Test" tag as my root element. How can I do that? The next few snippets of code:
QByteArray b;
...
QDomDocument xml;
xml.setContent(b); // It's ok, its working.
QDomElement root = xml.documentElement();
QDomNode node = root.firstChild();
...
Thanks,
Marcelo E. Geyer
I have an xml document and I need copy part of the content to a new xml document, following an example:
<?xml encoding="utf-8" ?>
<Library>
<Location>
<Test> <---- split here
.....
.....
</Test>
<Test2>
.....
.....
</Test2>
<Location>
</Library>
I want to create a new document xml taking the "Test" tag as my root element. How can I do that? The next few snippets of code:
QByteArray b;
...
QDomDocument xml;
xml.setContent(b); // It's ok, its working.
QDomElement root = xml.documentElement();
QDomNode node = root.firstChild();
...
Thanks,
Marcelo E. Geyer