mr_suleyman
31st January 2007, 11:17
Hi All Dear Friend,
I am very new in XML world and I try to parse XML file. I looked at some threads about XML and used some codes for reading XML. But Each time I got
"Running Low on memory, Connection with server Lost". I found a thread like my case. But I don't understand main reason for this. Our server is very new. I don't think that this is memory error. It is about XML operations.


long input_file_id
long xml_id, identId,retVal
long texts_enum, enum_node, textnode
String text_data(100)
String error_string(100),messageID(100),messageClass(100),subject(100)

|Open the XML file for reading.
input_file_id = seq.open ("/users/xuser/file.xml", "r" )

|Parse the XML file
xml_id = xmlRead(input_file_id, error_string)
seq.close(input_file_id)

| Start at the first node
identId = 0

identId = xmlFindFirst( "IDENTIFICATION", xml_id)
****
****
****



When I debug this code . I am waiting on identId = xmlFindFirst( "IDENTIFICATION", xml_id) and I get error I said. Additionally, My xml encoding is <?xml version="1.0" encoding="ISO-8859-1" ?>
. If the solution is encoding conversion, How can provide data accuracy.I have no luxury in any data lost due to encoding conversion.

How Can I Handle This Problem ?


Thanks ....


Thank you.

mr_suleyman
31st January 2007, 16:39
I tried it for new xml file with 8 KB. It worked. But I tried it for another xml file with 123 KB . Then program are waiting and give error " Low memory" and "connection is lost". How can handle bigger XML file. ?

Thanks

mr_suleyman
31st January 2007, 16:59
I debuged it with 123 KB xml. When I run this syntax

|* Parse the xml file
xml.id = xmlread(fd, error_string)

Program is waiting and give error messages I said. How can I read big XML file ?

NPRao
31st January 2007, 21:38
Assuming its a new server and you don't have enough load on it, then you have to check if your login has any ulimits specified.

[DEV:bsp]/app/common/home/bsp>ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 4292870144
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303

Synopsis
long xmlRead(long fp, ref string error, [ long whitespacehandling ] )
long xmlReadFromString(string xmlString, ref string error, [ long whitespacehandling ] )

XML library function
XmlNodePointer xmlRead(STREAM *fp, char *parserError, XmlContextPointer pContext);
XmlNodePointer xmlReadExt(STREAM *fp, char *parserError, XmlWhiteSpaceHandling whiteSpaceHandling, XmlContextPointer pContext);
XmlNodePointer xmlReadBuffer(char *buffer, unsigned long bufferSize, char *parserError, XmlContextPointer pContext);
XmlNodePointer xmlReadBufferExt(char *buffer, unsigned long bufferSize,char * parserError, XmlWhiteSpaceHandling whiteSpaceHandling, XmlContextPointer pContext);

Description
De-serialize an XML object by parsing an XML document and creating an in-memory object tree.

mr_suleyman
1st February 2007, 07:56
I looked at that
My setting

$ ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048

mr_suleyman
2nd February 2007, 16:08
I changed my mind. I have done it on JAVA with SaxParser. It is very flexible.


Thanks Napro.