Correct XML format for I_FILE with AOWSIMPORT?

I'm trying to work out the correct format for the I_FILE parameter when using AOWSIMPORT to do an import, when the template specified in I_MODIMP is an XML template.  I can get it working fine with a flat file structure for I_FILE, but I can't work out the format to use for an XML template.  

I've even tried doing an XML export, and then taking the same output and trying to re-import it, but whatever I do, I just get "Bad input XML parameters." or "Bad input JSON parameters.", depending on whether I'm specifying the rest of the params (e.g. I_MODIMP) as XML or JSON.

I can't find a working example of the required format for the XML for I_FILE.  Can anyone point me at something?

Top Replies

  • 0

    When you are reading the XML file into your local Clbfile parameter, what are the values for the Adxirs and Adxium parameters? I_FILE is expecting the contents of the file in a Clbfile variable, something like the code below will perform a full read of the XML file and then you can then pass it to AOWSIMPORT.  Alternatively make use of AOWSEXPORT to export an example record and then see the content formatting within the variable O_FILE looks like. 

    Local Char XLINE(250)
    Local Clbfile I_FILE(3)

    Openi filpath('tmp','XML','txt') Using [FIC1]
    Iomode Adxirs '' Using [FIC1]
    Iomode Adxifs chr$(13)+chr$(10) Using [FIC1]
    Iomode Adxium 50 Using [FIC1]
    while fstat = [v]CST_AOK
    Rdseq [L]XLINE Using [FIC1]
    Append I_FILE, [L]XLINE
    Wend
    Openi Using [FIC1]

  • +1
    verified answer

    Thanks   I had been exporting the XML already to create the XML file and then attempting to re-import it.  I found the problem - it was the quote's in the XML.  The output is XML, so contains quotes in the XML header.  I need to encode these quotes before doing the import - and that all works now.  So, be careful with your encoding is the answer....