Re: [xml] Pull parser termination



On Wed, Apr 10, 2002 at 01:53:26PM +0200, Fabrice DESRE - FT.BD/FTR&D/DTL/TAL wrote:
On Wed, 2002-04-10 at 11:37, Daniel Veillard wrote:
 
  Just in case you're interested it's discussed on the topic of 
an IETF draft on XML guidelines:
  http://www.imc.org/ietf-xml-use/mail-archive/msg00001.html
 
 Thanks Daniel for this pointer. You just touched some issues i'm facing
dealing with TCP/IP connections.
 I'm writing a SOAP toolkit (with libxml of course) and the "document
ending" problem appears twice :
1) The client POSTs an XML doc to the server (the SOAP request). Since I
can't rely on the client providing a content-length HTTP header and
obviously the TCP connection is not closed I have to use a trick. All
the implementations I know of use the endDocument SAX event to sync.
2) The server sends back the SOAP response to the client. If I want to
use HTTP/1.1 i'll have to use the same method as in 1). If I use
HTTP/1.0 I can sync the end of parsing with the shut down of the TCP
connection (not nice, but working with nanohttp for instance).

 My preference goes to something that do not rely on the HTTP version.
That's why I was wondering if the use of a custom endDocument callback
for my sax handler was a brain dead solution.

  No it's unfortunately the only way to cope with pipelining in an
HTTP-1.1 context. I dislike this, but there is no clear way around.
The solution is to check the depth of the node stack in the
parser context and when it goes back to 0 mark the end of the document
in the SOAP context. The problem is then to not get confused by
remaining spaces, commnets or PIs and also not miss the subsequent
XML Declaration if there is one.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]