[xml] I got libxml2 to link on Windows and repaired a "bug"

Note:  I am using 2.5.11 as that is what I use on my unix versions

1) I finally got the projects in order and manually modified the xmlversion.h file and fixed a link for that file (as it is include in one place and used in the build script in another). I could provide documentation on what I did but the consensus seemed to be not to use the projects anyway, so I probably did it the dumb way, but I'm happy being dumb :-)

2) I got it linked statically into my application and almost everything worked as well as unix with one exception --> if dumping a document to stdout I would loose all or part of it. After much hunting and agony I had to patch xmlIO.c as such just before the "return(0)" for stdout and stdin:

    if (fil == stdout || fil == stderr)

It was too late to do it in my program which does a xmlSaveFormatFile(...) -> e.g.:


does not work.

I did not get to the where/how/why of it, only that my patch works. I suspect it is partially application dependent in that my stdin and stdout and stderr are pipes to another process ... BUT ... since a close normally (logically) does a flush and then a close, it is probably a good idea and good practice to go ahead and flush the buffers as I did (because you correctly do NOT close stderr and stdout, but ... the flush should occur).

I can always make the change again in future versions so I have not heartache if this change is not made,
but I would ask that the powers that be consider it :-)

Thanks for those that gave me some help.

Eric S. Eberhard
(928) 567-3727          Voice
(928) 567-6122          Fax
(800) 569-1122 Denver Office (I am never there, you can leave a message)
(720) 339-4765          Cell


Completely updated web site of personal pictures with many new pictures! Includes horses, dogs, Corvairs, and more.


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