RFC: Implement XML loading in msxml3 directly from IStream

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Thu Oct 16 17:46:14 CDT 2008


Hello developers,

the current implementation of IPersistStream::Load for XMLDOMDocument
takes a copy of the given stream into a hglobal stream, and uses a
helper function to parse that, namely parse_xml that calls xmlReadMemory
if available (since 2.6.0) and uses the old xmlParseMemory call
otherwise.

If libxml2 is new enough, it is possible to parse directly from the
stream using xmlReadIO to avoid copying the whole stream contents to
memory. The function xmlReadIO was introduced in libxml 2.6.0, five
years ago. If I want to use that function, do I have to create an
alternative code path for such ancient libxml implemementations, or is
it OK to require libxml 2.6.0 as minimum for libxml (even Debian Sarge,
i.e. oldstable has it)?

Another question arose on looking at the current implementation. If Wine
is not going the direct-stream-to-libxml2-way, but wants to take a copy,
currently the copying is performed manually, although there is a
function CopyTo in IStream that takes care of creating the copy.

I attached two diff files,
 - load-via-readio.diff shows the way that calls stream callbacks from
libxml2
 - load-use-copyto.diff uses the CopyTo function, but still copies.

Thanks in advance for any feedback,
  Michael Karcher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: load-via-readio.diff
Type: text/x-patch
Size: 2410 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20081017/50c0b534/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: load-use-copyto.diff
Type: text/x-patch
Size: 884 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20081017/50c0b534/attachment-0001.bin 


More information about the wine-devel mailing list