Re: [xml] (Windows) xmlDocDump / xmlSavefile



Hi Trappel,

 

Thanks for you reply.

 

Over and above the functions that I have used below, the xmlSaveFormatFile was used as well. Unfortunately when I open the resultant file I see binary only. I would like to see the text instead.

 

Are there any prior settings that need to take place i.e. this is what I have done below and found this still to be a problem.

 

xmlSetCompressMode(0); // no compression, maybe this has no relebance

xmlKeepBlanksDefault(0);

 

xmlSaveFormatFile(path, doc, 1); // this file does not display the xml in text as I want it to be L

 

 

Thanks

 

Regards

 

Xen

 

 

 


From: Trappel Martin [mailto:martin trappel ksengineers at]
Sent: 10 May 2007 05:21
To: Xen Cloete
Cc: xml gnome org
Subject: RE: [xml] (Windows) xmlDocDump / xmlSavefile

 

Hi there.

 

Do not use this API unless you compile libxml together with you program.

The FILE* structure is incompatible btw. different crt versions and so you cannot guarantee that you program links to the same one as the compiled libxml2.

(Someone correct me if I'm wrong.)

 

You can use the xmlSaveFormatFile.. API just as well. It will even convert UTF8-Paths you pass it to UTF-16 windows paths.

 

best regards / mit freundlichen Grüßen,
Martin Trappel

 

(ps: these email disclaimers are generally not very well recieved here :-)

 


From: Xen Cloete [mailto:XenC hollard co za]
Sent: Thursday, May 10, 2007 4:35 PM
To: xml gnome org
Subject: [xml] (Windows) xmlDocDump / xmlSavefile

Hi,

 

Maybe someone could assist me here.

 

I am having trouble saving the contents of the xml file. I have an xmlDocPtr to the area in which the data lies however when I use xmlSaveFileFormat(path, doc, 1) the file seems to either be corrupt or in some sort of binary form.

 

I would like to see the contents of the file i,e, xml document in readable format.

 

I have tried xmlDocDump as well but I get an access violation, Maybe I am not using the function correctly. This is what I have:

 

FILE *fp;

 

fp = fopen("C:\\XMLDATA\\XMLResult.xml", "w+");

xmlDocDump(fp, doc);          // as I understand the xml documentation

fclose(fp);

 

Any suggestions will be great.

 

Thanks

 

Xen

 

"Hollard is a licensed Financial Services Provider (FSP) as defined in the Financial Advisory and Intermediary Services Act (FAIS). FAIS requires that anyone who makes any recommendation, guidance or proposal of a financial nature must be a duly authorised representative of a licensed FSP. If you are seeking financial advice, or if you feel that this email constitutes financial advice, or if the author of this email wants you to purchase, amend or cancel a policy, please check with the author that he/she is a registered representative of Hollard."

This email and all content are subject to the following disclaimer:

 

"http://www.hollard.co.za/legal/disclaimer.htm"

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]