Results 1 to 2 of 2

Thread: DOM - reading from std::istream?

  1. #1
    Junior Member
    Join Date
    Apr 2007

    DOM - reading from std::istream?

    Hi, my current application framework which I want to make Collada ready uses a self written filemanager which can read from zip files and directories, using std::istream.

    I couldn't find any way how to build a DAE out of a std::istream. Is there a certain reason for the DOM not providing such a way, or is this way somehow not possible due to the general organisation of the DOM?

    Is it possible to add such a support in some upcoming dom releases?


    @mods: i realized this is in the wrong subforum. please move it to the implementation forum.

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Foster City, CA
    Unfortunately there's no direct support for istreams. Internally, the DOM uses libxml's xmlreader module to parse xml. They don't provide an interface for parsing from a C++ istream (not surprising since libxml is mostly pure C). I do notice they have an xmlReaderForIO function where you provide callbacks to do the stream input. Maybe that could be used to provide direct support for istreams.

    The DOM can parse an in-memory document though, so you could load the data from the istream into a buffer and pass that to the DOM. Here's some sample code for that:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean