Restoring the book Object
At this point you have written the book object XML data to the file book.xml. Next you are ready to restore the object, which involves:
*reading in the file book.xml
*transforming the XML back to the form required by XML streams
*restoring the object as book2
 
{
ifstream fin("book.xml"); //1
ifstream script("../XmlStreamIn.xsl"); //2
 
RWObjectInputStream in = //3
RWXsltObjectInputStreamImp::make(fin,script);
in >> book2; //4
}
//1 Creates an ifstream for reading in the object data.
//2 Creates an ifstream for reading in the input XSLT stylesheet.
//3 Sets up an XML input stream that includes support for a transformation by passing the ifstream to the input XSLT stylesheet.
//4 Restores the book object as the book2 instance create earlier, transforming the XML back to the expected XML format in the process.