This topic explains how to serialise a DOM document and save it to a file.
Before you start, you must:
understand the concepts of Document Object Model (DOM) and serialisation
understand the structure and classes of the XML DOM Engine component
have created an RXmlEngDocument (called myDoc in this example), either by parsing an XML file (as indicated in the XML DOM Parsing Tutorial) or by adding nodes to a new DOM tree.
The XML Engine is based on the libxml2 library, which supports the serialisation of XML documents. This process converts a DOM tree into a format that can be saved to a file or transferred through a network connection.
This tutorial explains how to save an existing XML document to a file. To store the result in a buffer, use the SetOutput(RBuf8&) method instead of the SetOutputL(TDesC&) method used below.
The data in the myDoc XML document is stored in the tutorial.xml file.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.