![]() |
libXML++ |
![]() |
![]() |
What is libXML++?Just have a look at the name:
What can you do with libXML++?Thats simple: you can parse XML. Nothing more, nothing less.It doesn't include http and ftp clients, can't read your mail via POP3, doesn't use any CORBA-functionality, and even can't open files! It's just an XML-Parser... Put in some strings, and it will parse them. Simple, isn't it? So it's just a Wrapper for gnome-xml?Yes and No: Momentarily it uses a small part of libxml to do most of the work, but the Interface has been designed to hide that. That means it's possible to exchange libxml with some other lib or include the required Parser directly into libXML++ without breaking compatibility.Why don't you include nano-http, etc. support from libxml?A library should be kept as simple as possible, and should be portable and usable by a wide variety of programs.There are many possible sources of XML-Data, e.g. Files, Servers, Databases. A single library can never cover all of them, so I decided to include none. But, why can't libXML++ read files?Why should it? How should it?Should it only read entire files? Should it read from a already opened filehandle? Should you pass an istream, a pure unix filehandle, a struct FILE, a filename or even a QFile? How about reading only parts of a file? What if the file is gziped, compressed, encrypted? As you see, there're thousands of ways to handle Files! Why should a library force you to choose one of them? Isn't it much better to make no assumptions about the source of your data and keep all possibilities open? Where's the DOM-Support?Hey, I wanted to make a ObjectOrientated Library! Now have a look at DOM and tell me where DOM is at least a little bit OO (except for the "O" in the name).Of course it's normal for a program to use trees of objects as storage for it's document, but in a OO environment it's absolutely nonsense to use the same class for all Elements. So it would be possible to create a DOM-Tree, but it would be useless in a OO program, as it had to be converted in some other datastructure to be useful. So instead of supporting DOM I decided it's better to make it easy to create your own Datastructures directly. Where's the ducumentation?There isn't one, yet. But the comments in the source are intended to be compatible with doc++, kdoc, javadoc and a thousend other source to html converters. |