![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: IXMLDOMDocumentPtr::save don't format output [Thread Next] Re: IXMLDOMDocumentPtr::save don't format outputTo: NULL Date: 1/5/2005 9:48:00 AM >> I have a problem: >> IXMLDOMDocumentPtr::save don't format the output in a nice humanreadable >> format like: >> >> <topLevel> >> <nextLevel> >> <myData> data </myData> >> </nextLevel> >> </topLevel> >> >> but more like this: >> <topLevel><nextLevel><myData> data </myData></nextLevel></topLevel> > If you load from a file with proper formatting and indentation then I am > sure if you set > xmlDocument.preserveWhiteSpace = true; > before loading and then later save that the formatting is preserved. > However if you construct a new document from scratch using DOM methods > (e.g. createElement, createTextNode, appendChild) then indeed you need > to ensure yourself that the document is properly formatted for saving. > One way to do that is to use XSLT to format the document, this older > post contains an XSLT 1.0 stylesheet doing that: > <http://groups-beta.google.com/group/microsoft.public.dotnet.xml/msg/3545b35d0886d49c?dmode=source> > > Can't help you with C++ but perhaps you are able to transcribe the > JScript code to C++ yourself. > Thanks for your response, Martin Indeed I create the structure from scratch, so unfortunatly I can't use .preserveWhiteSpace I have an xsd scheme that I can pump out to the working folder, could that be of use? | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
