Bjoern Hoehrmann wrote:
> 
> * AndrewHartley wrote:
>>I have a valid XML file loaded into an xmlDocPtr and would like to
>>successfully save to file.  When I use the xmlSaveToFilename:
>>
>>[code]
>>   xmlSaveToFilename(szFilepath, NULL, 0);
>>[/code]
>>
>>The file isn't succsfully written.  I would appreciate any helpful advice.
> 
> You don't pass any node to the function, so how would it know what you
> want to save? xmlSaveToFilename creates a new xmlSaveCtxtPtr, you have
> to use xmlSaveTree to actually save anything using the context.
> -- 
> Björn Höhrmann · mailto:[EMAIL PROTECTED] · http://bjoern.hoehrmann.de
> Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
> 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
> 
> 


Thank you.  I worked it out now:
[code]
xmlSaveCtxtPtr ctxt = xmlSaveToFilename( szFilepath, NULL, 0 );
long ret = xmlSaveDoc( ctxt, m_pXmlDoc );
ret = xmlSaveClose( ctxt );
...
[/code]

-- 
View this message in context: 
http://www.nabble.com/xmlDocPtr-save-to-file-tp18319565p18320853.html
Sent from the Gnome - Lib - Xml - General mailing list archive at Nabble.com.

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to