I have borrowed the technique from one of the sample. He generated to JSON output but I generated in XML outputI have an agent that generate the xml on the fly. Here is the problem. If the agent produces the large volume of data, xml output is trancated and generates incompleted format. It will work fine for small volume of data. I am not sure what causes of the problem. Is it the print statement (Print “[” + XMLOutput + “]”) that can not output a large string?
This is also a problem whether I generate in JSON format.
Anyone has suggestion,
thanks in advance,
Pat
Here is the code:
XMLOutput = “<?xml version='1.0' encoding='UTF-8'?>”
Set rcol = dbview.GetAllDocumentsByKey(key)
If rcol.count > 0 Then
For i = 1 To rcol.count
Set rdoc = rco.GetNthDocument(i)
XMLOutput = XMLOutput + |<document id=| + Cstr(i) + |><name>| + Cstr(Ucase(rdoc.LName(0)) + " " + Ucase(rdoc.MName(0)) + " " + Ucase(rdoc.FName(0))) + |</name>| +_
|<phone>| + Cstr(rdoc.Phone(0)) + |</phone>| +_
|<fax>| + Cstr(rdoc.Fax(0)) + |</fax>| +_
|<ext>| + Cstr(rdoc.Ext(0)) + |</ext></document>|
Next
End If
XMLOutput = XMLOutput + “”
Print “Content-type: text/plain”
Print “[” + XMLOutput + “]”