UrShape XML parser (Was: Shapes layout proposal)



From my perspective, the library that gets the UrShape off the
disk and into an instantiated object is the object to use.  I'm
still hoping 1) not to do this alone and 2) not to write the I/O
code.  The latter because I've done it so often it would feel like
work (or sleep).  I assume I won't be parsing the XML.  I assume
some library will do that for me.
Doesn't libxml do the parsing? Do you mean gfxIO or fileIO? Sincee
I'll need exactly the same thing (parsing xml into an instanciated
object) for my diploma thesis, I'll lend a hand anyway. I just fire up
my Search Engine and look for a lib that does the work for us. Hang on
a few minutes... ;)
Time for a few more thoughts:
James has written a libxml/SAX tutorial which seems to fit in nicely.
The only thing to do here is the callback stuff. Since we have our own
object management stuff, we can afford writing the xml from within the
object management. With this, we can also do the integer conversion on
the fly, and whatever you prefer to do once while loading/saving. I'll
wade the code somewhat deeper 'til next week, so I hope to be able to
implement the parsing stuff by the time of 2 weeks, if not sooner -
I'll need it for my diploma anyway ;). Given the urshape.h this
shouldn't be too difficult...

The advantages are:
* We already use libxml - no new bindings created, so this extension
will work in the same environment as before.
* We can parse the stuff in any format we need. Wherever conversions
(like char* -> integer) are useful, we follow Nike and just do it ;)
* The SAX stuff slurps up less memory than a whole DOM parser.
* We can also add simple callbacks (object management - remember?) to
perform i.e. serialization, even gfx routines, etc.

I don't yet know the disadvantages of this approach, so James, if you
are around, please tell me. (Is this overkill? Can we reuse code?)

cu Andre
-- 
Tolerance rulez, everything else sux! -- Andre Kloss





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