Re: [Quickfix-developers] Critical LIBXML_DOMDocument.cpp patch for QuickFIX 1.4
Brought to you by:
orenmnero
From: Gene G. <mus...@ya...> - 2003-03-19 07:12:59
|
Attached is another patch which deals with XML parsing. DataDictionary did not ignore empty nodes which were siblings of "value" correctly. I have also made exceptions text a tad more informative here and there. Gene --- Gene Gorokhovsky <mus...@ya...> wrote: > LIBXML implementation of DOMDocument has a problem: > it > skips over every second node. I am not sure whether > the idea was to skip over newlines or some such, but > the end-result is that on my configuration (Redhat > Linux AS 2.1, libxml 2.4.24. gcc 3.21) only half of > the spec xml gets read into memory. This leads to > disasterous consequences -- acceptor cannot even be > created with half of the fields definitions missing. > I have attached a patch; fixed code does not skip > nodes. > > If the reasoning behind double-step was indeed to > skip > useless newline nodes (and not a plain oversight), > check out xmlKeepBlanksDefault () in libxml2. > > Gene > > __________________________________________________ > Do you Yahoo!? > Yahoo! Platinum - Watch CBS' NCAA March Madness, > live on your desktop! > http://platinum.yahoo.com> --- /home/geneg/tmp/LIBXML_DOMDocument.cpp Wed Mar > 19 01:11:51 2003 > +++ LIBXML_DOMDocument.cpp Wed Mar 19 01:13:44 2003 > @@ -72,6 +72,5 @@ > DOMNodePtr LIBXML_DOMNode::getFirstChildNode() > { > - if( !m_pNode->children ) return DOMNodePtr(); > - xmlNodePtr pNode = m_pNode->children->next; > + xmlNodePtr pNode = m_pNode->children; > if( pNode == NULL ) return DOMNodePtr(); > return DOMNodePtr(new LIBXML_DOMNode(pNode)); > @@ -80,6 +79,5 @@ > DOMNodePtr LIBXML_DOMNode::getNextSiblingNode() > { > - if( !m_pNode->next ) return DOMNodePtr(); > - xmlNodePtr pNode = m_pNode->next->next; > + xmlNodePtr pNode = m_pNode->next; > if( pNode == NULL ) return DOMNodePtr(); > return DOMNodePtr(new LIBXML_DOMNode(pNode)); > __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com |