[gdome]Feedback on using gdome2 in C++ via gmetadom (and a problem with charsets)



Hello,

I'm happily using gdome2 through the gmetadom-generated binding for C++
present in libgdome2-cpp-smart-dev debian package.

First thing I have to say is: "great binding!"  Thanks Luca!

Some misc notes after some hours of coding:

 DOMString lacks a constructor, and assignment operator that reads a
 std::string value, and an assignment operation for std::string that
 reads a DOMString value.  It is not essential, but it would be greatly
 appreciated.

 Exception error codes have something wrong, since I've seen exceptions
 with codes pretty different from these declared as constants in
 DOMException::DOMExceptionCode.  One example is at the end of the message.
 
 If I add a node twice to some other node, the second time the operation
 fails doing nothing, without throwing exceptions or giving other
 feedbacks.


Then I'd wish to submit you a small problem I have.

I'm writing a proof-of-concept utility that loads a Galeon XBEL bookmark
file, sort its nodes in untold ways (without touching the strings it
contains) and then saves it in a new file.

During the DOMImplementation::saveDocumentToFile(Document, const char*)
method, I get this on standard error:

Code:
	fprintf(stderr, "Saving new document...\n");
	impl.saveDocumentToFile(doc, file_out);
	fprintf(stderr, "Done.\n");

Output:
	Saving new document...
	xmlEncodeEntitiesReentrant : char out of range
	Done.

After some runs of load/sort/save on a given file, some items that had
accented characters look this way:

<title>H&#195;&#131;&#194;&#131;&#195;&#130;&#194;&#131;&#195;&#131;&#194;&#130;sand[...repeats for an average of 4000 characters...]</title>

Even more interesting, gdome2 is unable to read its output:

[When trying to load the saved file]
bookmarks1.xbel:5345: error: Input is not proper UTF-8, indicate encoding !
folded="yes"><title>Mozilla Project</title><folder folded="yes"><title>Universi
                                                                              ^
bookmarks1.xbel:5345: error: Bytes: 0xE0 0x3C 0x2F 0x74
folded="yes"><title>Mozilla Project</title><folder folded="yes"><title>Universi
                                                                              ^
Merging document info...
DOMException: Node::get_childNodes (100)

(Line 5345 is:
        </bookmark></folder><folder folded="yes"><title>Sistemi Distribuiti 3</title><folder folded="yes"><title>Developer Information</title><folder folded="yes"><title>Mozilla Project</title><folder folded="yes"><title>Università</title><bookmark href="http://www.faqs.org/rfcs/";>
)

[Note: code 100 does not correspond to a constant in DOMException::DOMExceptionCode]


				Bye, Enrico

--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico debian org>



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