Trisli
3rd December 2004, 11:14
Hi all,

I have been trying to generate a large XML file. Unfortunately it seems that I am running into a "buffer full" situation, as the file ends in the middle of the genration phase without ending the file correctly.

Question is now: Is it possible to generate such (very large) XML files?
:confused:

Thanks!

I have attached the (failing) code, that I have been using so far.

Best regards
Soeren Lildal


|******************************************************************************
|* com9999
|* Test - write basic data
|******************************************************************************
|* Script Type: 3GL
|******************************************************************************

table ttiitm001 |* Items

long retVal

extern domain tcmcs.long xml_fileid
extern domain tcmcs.long xml_mainnode

extern domain tcmcs.long file.ptr

function main()
{
xml_fileid = xmlNewNode("Items", XML_ELEMENT)

select tiitm001.item, tiitm001.dsca
from tiitm001
selectdo
xml_mainnode = xmlNewNode("Item", XML_ELEMENT, xml_fileid)

retVal = xmlNewDataElement("Item", strip$(shiftl$(tiitm001.item)), xml_mainnode)
retVal = xmlNewDataElement("Description", strip$(shiftl$(tiitm001.dsca)), xml_mainnode)
endselect

retVal = xmlWritePretty(file.ptr, xml_fileid, 0 )

seq.close(file.ptr)
file.ptr = 0

retVal = xmlDelete(xml_fileid, 0)
}

|* **** end of source ****


| I tried generation the file record-by-record using the functions below, but could not obtain
| a valid XLM format of the final file
|
| string test.buffer(1024)
|
| Main:
| xmlWritePrettyToString(test.buffer, xml_fileid)
| Each row:
| xmlWritePrettyToString(test.buffer, xml_mainnode, xml_mainnode )
|
| This did indeed result in individual nodes being generated one-by-one, but for each of them
| a line containing: <?xml version="1.0"?> was generated. Furthermore I could not figure out
| how to generate the closing of the main-node.

Francesco
3rd December 2004, 18:43
Versions IV and 5 have no full-blown XML functionality. Curious what LN will have to offer there.

The generator requires you to build a full XML object in memory before writing it to file.
If you are getting buffer overflows, I assume that you need more memory (or virtual memory) assigned to you.

p.cole
3rd December 2004, 22:53
SSA have just released a load of functions for handling XML for Baan IV. I will try to dig out the documentation.

ahulikavi
6th December 2004, 05:42
You can download the Help file for new XML functions from ( You need access to Support Site )

http://secure1.support.baan.com/ftpdownload/updates/B40c4/progguide.chm (http://http://secure1.support.baan.com/ftpdownload/updates/B40c4/progguide.chm)

Trisli
6th December 2004, 12:07
Hi Akshay,

Thanks for your kind reply and your link to the (newest) documentation. It seems that there definitely are several interesting new functions available. My question is now: Will these new functions be available on BaanIV and/or BaanV ...and if so, which solutions will deliver the functionality?

I am especially interested in:
xmlGetPrettyStringLength(...), and
xmlAllocPrettyString(...)
None of these functions are available on my system.

I have tried searching "Baan Support" but did not find any solutions, that delivers these functions.

Thanks!

Best regards
Soeren Lildal