Re: [xml] xmlReadMemory limitation




Could it be my use of the function: It looks like this:



------------------------------------------------------
int OpenInterestPositions(xmlNode* a_node)
{
  xmlNode *cur_node = NULL;
  xmlNode *root_element = NULL;

  if(a_node->type == XML_TEXT_NODE){

    xmlDocPtr doc;


    doc = xmlReadMemory(a_node->content, 400000, "noname.xml", NULL, 0);
    if (doc == NULL) {
      Log_PrintFile("Failed to parse xml document from the soap message\n");
      return -1;
    }

    root_element = xmlDocGetRootElement(doc);

    for (cur_node = root_element; cur_node; cur_node = cur_node->next) {
      if(cur_node->type == XML_ELEMENT_NODE) {
       
        if(strcmp(cur_node->name,"open_interest")==0){
          if(Open_Interest(cur_node->children) != 0)
            goto Error;
        }
      }
    }
    xmlFreeDoc(doc);
  }
----------------------------------------------------------
The reason for using it like this is that the xml is recevied through the csoap library from a JBoss webservice.

I have tried to do it useing "sizeof(a_node->content)" but for some reason I only get 4 as the size (looks like the size of the adress.  [I have also tried to get the content first using the xmlNodeGetContent() function, but the result was the same]

/Espen
MSN: espene halden net



Daniel Veillard <veillard redhat com>

11.03.2005 10:21
Please respond to veillard

       
        To:        Espen Ekeroth <espen ekeroth omxgroup com>
        cc:        xml gnome org
        Subject:        Re: [xml] xmlReadMemory limitation



On Fri, Mar 11, 2005 at 08:26:51AM +0100, Espen Ekeroth wrote:
> On RedHat 9 i do get a problem using xmlReadMemory(). It seems like if the
> memory buffer size is set to a value larger than 600000 it do fail. (no
> coredump or anything, but the application just dies). Is this a limit of
> xmlReadMemory ?

 xmllint.c uses xmlReadMemory() for processing with --memory

paphio:~/XML -> ls -l dba100000.xml
-rw-rw-r--  1 veillard www 14282040 Jan  4 16:06 dba100000.xml
paphio:~/XML -> xmllint --noout --memory dba100000.xml
paphio:~/XML -> echo $?
0
paphio:~/XML ->

 i.e. I cannot reproduce your problem on Red Hat Enterprise Linux 4.

> or is it the infamous 640kb problem of x86 also affecting
> linux?

 Certainly not, linux uses flat 32bit addressing and not 16bit
segmented memory accesses !!!

> This e-mail and the information it contains may be privileged and/or
> confidential.  It is for the intended addressee(s) only.
> The unauthorised use, disclosure or copying of this e-mail, or any information it contains, is prohibited.
> If you are not an intended recipient, please contact the sender and delete the material from your computer.

 This notice is incompatible with the usage of the mailing list,
we will copy archive and redistribute copies of mails sent to the list
to anybody in the Internet. Remove it or unsubscribe this
address from this list :-(

Daniel

--
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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