[xml] possible problem with xmlSaveFormatFile



I'm currently using the libxml2 library (2.5.3) on various platforms* and I'm
having problems with formatted output on the win32.


I create a file containing formatted XML by just writing to like any normal
file. Subsequently, a later process comes along, reads the file into the libxml2
datastructures, it adds some children and then the whole thing is written out
using  xmlSaveFormatFile (fullManifestPath, manifestDoc, 1); . The end result
looks like:

<?xml version="1.0"?>
<Manifest>
  <Product>
    <productIdentity type="release" category="Tools" name="Genlin"
version="1.1r1" revision="Final"/>
    <Build>
      <Variety>
        <install-style>single-dir</install-style>
        <visible>v</visible>
        <regime>rel</regime>
        <platform>win_32-pentium</platform>
      </Variety>
    </Build>
    <Installation>
      <file href="../"/>
      <datetime>Wed Mar 05 11:24:02 2003</datetime>
    </Installation>
  </Product>
  <Product>
    <productIdentity type="release" category="RIPs" name="PC"
version="Eclipse_Release" revision="Final"/>
    <Build>
      <Variety>
        <customised>HIGHWI</customised>
        <platform>win_nt-pentium</platform>
        <morisawa>m</morisawa>
        <dll>d</dll>
        <install-style>single-dir</install-style>
        <ripapi>omni</ripapi>
        <security>dng</security>
        <config>nc</config>
        <parallel>np</parallel>
        <regime>rel</regime>
      </Variety>
    </Build>
    <Installation>
      <file href="../"/>
      <datetime>Wed Mar 05 11:24:02 2003</datetime>
    </Installation>
  </Product>
  <Product>
    <productIdentity type="release" category="RIPs" name="Headless"
version="Eclipse_Release" revision="Final"/>
    <Build>
      <Variety>
        <customised>HIGHWI</customised>
        <platform>win_nt-pentium</platform>
        <morisawa>m</morisawa>
        <dll>d</dll>
        <install-style>single-dir</install-style>
        <ripapi>omni</ripapi>
        <security>dng</security>
        <config>nc</config>
        <parallel>np</parallel>
        <regime>rel</regime>
      </Variety>
    </Build>
    <Installation>
      <file href="../"/>
      <datetime>Wed Mar 05 11:24:02 2003</datetime>
    </Installation>
  </Product>
<Product><productIdentity type="release" category="Plugins\Input"
name="appletalk" version="1.2r4"
revision="Final"/><Build><Varieties><install-style>single-dir</install-style><regime>rel</regime><platform>win_nt-pentium</platform></Varieties></Build><Installation><file

href="../SW/Inputs"/><datetime>Wed Mar 05 11:25:45
2003</datetime></Installation></Product><Product><productIdentity type="release"
 category="Plugins\Extensions" name="crd" version="Eclipse_Release"
revision="Final"/><Build><Varieties><install-style>single-dir</install-style><regime>rel</regime><platform>win_32-pentium</platform></Varieties></Build><Installation><file

href="../SW/Crdgen"/><datetime>Wed Mar 05 11:25:46
2003</datetime></Installation></Product></Manifest>


As you can see (if your mailer hasn't reformatted it beyond belief) the last
products (those with productIdentity that contain attributes of Plugins and
which represent nodes added by the second process) have not been formatted,
although the others have. The file was written again using xmlSaveFormatFile.

It doesn't effect the browser: it's seems to me that the function doesn't do
what it says on the tin, although I could be missing something.

Roger

* it compiles nicely across all our supported platforms, including Irix and
Solaris, *except* MrC on Classic but I haven't tried the latest compiler yet.





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