You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(157) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(78) |
Feb
(246) |
Mar
(83) |
Apr
(32) |
May
(99) |
Jun
(85) |
Jul
(34) |
Aug
(24) |
Sep
(65) |
Oct
(60) |
Nov
(45) |
Dec
(90) |
2004 |
Jan
(8) |
Feb
(40) |
Mar
(12) |
Apr
(17) |
May
(56) |
Jun
(13) |
Jul
(5) |
Aug
(30) |
Sep
(51) |
Oct
(17) |
Nov
(9) |
Dec
(20) |
2005 |
Jan
(16) |
Feb
(22) |
Mar
(14) |
Apr
(6) |
May
(12) |
Jun
(41) |
Jul
(21) |
Aug
(26) |
Sep
(7) |
Oct
(42) |
Nov
(10) |
Dec
(7) |
2006 |
Jan
(6) |
Feb
(9) |
Mar
(19) |
Apr
(7) |
May
(1) |
Jun
(10) |
Jul
(5) |
Aug
|
Sep
|
Oct
(8) |
Nov
(9) |
Dec
(3) |
2007 |
Jan
(1) |
Feb
|
Mar
(7) |
Apr
(5) |
May
(10) |
Jun
(32) |
Jul
(6) |
Aug
(8) |
Sep
(10) |
Oct
(3) |
Nov
(11) |
Dec
(2) |
2008 |
Jan
(3) |
Feb
|
Mar
(11) |
Apr
|
May
(6) |
Jun
(4) |
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(3) |
2010 |
Jan
(3) |
Feb
(6) |
Mar
(16) |
Apr
(2) |
May
|
Jun
|
Jul
(7) |
Aug
(3) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Murray C. <mu...@mu...> - 2009-01-08 18:27:24
|
On Thu, 2009-01-08 at 18:40 +0100, raoul wrote: > Ok, just saw that bug report http://bugzilla.gnome.org/show_bug.cgi?id=348006 Does that patch fix your problems, without also applying your own patch? -- mu...@mu... www.murrayc.com www.openismus.com |
From: raoul <rao...@gm...> - 2009-01-08 17:39:53
|
Ok, just saw that bug report http://bugzilla.gnome.org/show_bug.cgi?id=348006 ... Le jeudi 8 janvier 2009, raoul a écrit : > Hi there, > > I'm working with TextReader, and I had some trouble wen playing with > exceptions. In fact it was a problem in read() function. > > Here is the thing, when doing: > > xmlpp::TextReader reader("example.xml"); > > while(reader.read()) > { > [...] > } > > and if the xml file has a parse error, it just fall in an infinite loop > because read() always read the same node. > In fact, according to the xmlTextReaderRead() doc, this function can return > -1 if an error occured, and not just a boolean value. > Attached is a patch to make this work and also throw an exception. -- ------------------------ Raoul Hecky |
From: raoul <rao...@gm...> - 2009-01-08 17:32:00
|
Hi there, I'm working with TextReader, and I had some trouble wen playing with exceptions. In fact it was a problem in read() function. Here is the thing, when doing: xmlpp::TextReader reader("example.xml"); while(reader.read()) { [...] } and if the xml file has a parse error, it just fall in an infinite loop because read() always read the same node. In fact, according to the xmlTextReaderRead() doc, this function can return -1 if an error occured, and not just a boolean value. Attached is a patch to make this work and also throw an exception. -- ------------------------ Raoul Hecky |
From: Fabian J. <fab...@gm...> - 2008-09-18 01:45:02
|
Thank you. I think It can help me. Karsten Patzwaldt> I forgot to say I was on windows :-) So I don"t have configure. 2008/9/18 lovecreatesbea... . <lov...@gm...> > On Wed, Sep 17, 2008 at 9:48 PM, Fabian Jacquet > <fab...@gm...> wrote: > > Hi all, > > > > I want to compile libxml++ 2.22.0 > > I have to know all dependencies. Could you give me the name and the > version > > of each dependencies needed for 2.22.0? > > I need to compile each dependencies too, if you can help me too find all > > sources, it would be very kind. > > The web page says so: > > <quote> > http://libxmlplusplus.sourceforge.net > > Required Libraries > libxml2 > glibmm-2.4 (or a subset of it containing at least Glib::ustring) > </quote> > > I installed binary package libxml++2.6-dev on debian. This package > seems to be a libxml++ 2.14.0 implementation <url: > http://packages.debian.org/etch/libxml++2.6-2>. It has these > dependencies: > > $ ldd /usr/lib/libxml++-2.6.so > linux-gate.so.1 => (0xffffe000) > libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7e6c000) > libglibmm-2.4.so.1 => /usr/lib/libglibmm-2.4.so.1 (0xb7e23000) > libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7de9000) > libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0xb7de3000) > libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7d51000) > libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7c6c000) > libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7c47000) > libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7b15000) > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7b0a000) > libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7b06000) > libz.so.1 => /usr/lib/libz.so.1 (0xb7af2000) > libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7aef000) > librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7ae6000) > /lib/ld-linux.so.2 (0x80000000) > libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7ad3000) > $ > > This is Makefile for my xml config module: > > $ cat Makefile > > ################################################################################ > # Filename : Makefile > # Description : Makefile for xml config module > # Author : lov...@gm... > # Date : May 19, 2008 > > ################################################################################ > > CXX = g++ > CXXFLAGS = -ansi -pedantic -Wall -W -g \ > -I/usr/include/libxml++-2.6 \ > -I/usr/include/glibmm-2.4 \ > -I/usr/include/glib-2.0 \ > -I/usr/lib/glib-2.0/include \ > -I/usr/lib/glibmm-2.4/include > LDFLAGS = -lglibmm-2.4 -lxml++-2.6 > OBJS = main.o cfg.o > OUT = cfg.out > > $(OUT) : $(OBJS) > $(CXX) $(LDFLAGS) $^ -o $@ > > main.o cfg.o : cfg.h > > .PHONY : clean > clean : > rm $(OUT) $(OBJS) > $ > |
From: lovecreatesbea... . <lov...@gm...> - 2008-09-17 19:24:11
|
On Wed, Sep 17, 2008 at 9:48 PM, Fabian Jacquet <fab...@gm...> wrote: > Hi all, > > I want to compile libxml++ 2.22.0 > I have to know all dependencies. Could you give me the name and the version > of each dependencies needed for 2.22.0? > I need to compile each dependencies too, if you can help me too find all > sources, it would be very kind. The web page says so: <quote> http://libxmlplusplus.sourceforge.net Required Libraries libxml2 glibmm-2.4 (or a subset of it containing at least Glib::ustring) </quote> I installed binary package libxml++2.6-dev on debian. This package seems to be a libxml++ 2.14.0 implementation <url: http://packages.debian.org/etch/libxml++2.6-2>. It has these dependencies: $ ldd /usr/lib/libxml++-2.6.so linux-gate.so.1 => (0xffffe000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7e6c000) libglibmm-2.4.so.1 => /usr/lib/libglibmm-2.4.so.1 (0xb7e23000) libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7de9000) libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0xb7de3000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7d51000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7c6c000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7c47000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7b15000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7b0a000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7b06000) libz.so.1 => /usr/lib/libz.so.1 (0xb7af2000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7aef000) librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7ae6000) /lib/ld-linux.so.2 (0x80000000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7ad3000) $ This is Makefile for my xml config module: $ cat Makefile ################################################################################ # Filename : Makefile # Description : Makefile for xml config module # Author : lov...@gm... # Date : May 19, 2008 ################################################################################ CXX = g++ CXXFLAGS = -ansi -pedantic -Wall -W -g \ -I/usr/include/libxml++-2.6 \ -I/usr/include/glibmm-2.4 \ -I/usr/include/glib-2.0 \ -I/usr/lib/glib-2.0/include \ -I/usr/lib/glibmm-2.4/include LDFLAGS = -lglibmm-2.4 -lxml++-2.6 OBJS = main.o cfg.o OUT = cfg.out $(OUT) : $(OBJS) $(CXX) $(LDFLAGS) $^ -o $@ main.o cfg.o : cfg.h .PHONY : clean clean : rm $(OUT) $(OBJS) $ |
From: Fabian J. <fab...@gm...> - 2008-09-17 06:49:02
|
Hi all, I want to compile libxml++ 2.22.0 I have to know all dependencies. Could you give me the name and the version of each dependencies needed for 2.22.0? I need to compile each dependencies too, if you can help me too find all sources, it would be very kind. Thank you very much. |
From: Matthias W. <m...@tt...> - 2008-08-03 10:19:40
|
Hi Sean! Sean Farrell schrieb: > I see the initial motivation of using Glib::ustring, since the strings > handled are UTF-8. But if one looks at the code, Glub::ustring is just > used as a container for UTF-8 and no real operations are done. This is not correct. One big difference between Glib::ustring and std::ustring is the way lengths and positions in the string are handled. If you ask a std::ustring for its length you get the number of bytes, if you ask Glib::ustring you get the number of characters. Same if you handle with substrings and that like. This is very important if you have to truncate strings, with std::ustring you always risk to split a UTF-8 character in its middle if you do not take special care. Matthias |
From: Sean F. <sea...@ri...> - 2008-08-02 15:39:51
|
Hello, i have been using libxml++ and find it is one of the cleanest implementations. There is only one slight drawback, that is the use of GLib::ustring. If you are using it out of a Gtk application that is not an issue. That was my usage scenario up unit now. The problem is, if you are not in a Gtk application linking glibmm plus all it's dependencies is really overkill. I see the initial motivation of using Glib::ustring, since the strings handled are UTF-8. But if one looks at the code, Glub::ustring is just used as a container for UTF-8 and no real operations are done. As a result std::string can also be used for that. It would drop that one (mostly useless) dependency and really open libxml++ up for non Gtk / Gnome applications. I would like you comments on that subject. I am willing to do the change, since I am currently thinking of doing it locally form me, but that is not the spirit of working together... Regards, Sean Farrell (Yes this is my first post here...) |
From: Fabian J. <fab...@gm...> - 2008-06-16 09:19:48
|
Hi all, I use libXML++ 2.18.1 in a multi thread program and some times I have "Access violation" error. After lot of research it's seams to be this code which is not multi thread: Glib::ustring myStr = "test"; if(myStr == "some str") i = 0; The debugger stop on the following line of the operator= of Glib::ustring lhs.compare(rhs) I think this code is not multi thread because if I run 6 thread which just do this (with events to be synchronised) I have the same error... |
From: Murray C. <mu...@mu...> - 2008-06-12 13:23:10
|
Is anyone using xmlpp::TextReader? Apparently it does not report parse failures, which makes it seem useless to me. There's a patch to fix it but it would break ABI: http://bugzilla.gnome.org/show_bug.cgi?id=348006 That's only an option if nobody is using it. -- mu...@mu... www.murrayc.com www.openismus.com |
From: lovecreatesbea... . <lov...@gm...> - 2008-05-21 05:57:29
|
Dear libxml++ developer, Where can I find a full specification for your libxml++ classes and their members? For example: some members come with no description in below link to the reference doc. Is it guaranteed for me to make a xmlpp::TextReader::move_to_next_attribute() call without a previous move_to_first_attribute() call? They both present on your short manual page. Suppose I have an xml file as follow. Why does it report the `database' element and the attribute twice? Can I suppress the `#text' things. <database provider="mysql">scm2</database> --- node --- name: database depth: 1 attributes: dbms: mysql novalue --- node --- name: #text depth: 2 no attributes value: 'scm2' --- node --- name: database depth: 1 attributes: dbms: mysql novalue --- node --- name: #text depth: 1 no attributes value: ' ' - lovecreatesbea...@gmail.com <quote url=http://libxmlplusplus.sourceforge.net/docs/reference/html/classxmlpp_1_1TextReader.html#3ffee74ac337f73f3205d23c3c0eafec> [...] bool xmlpp::TextReader::move_to_first_attribute ( ) bool xmlpp::TextReader::move_to_next_attribute ( ) [...] </quote> |
From: Murray C. <mu...@mu...> - 2008-05-04 08:27:22
|
On Sun, 2008-05-04 at 00:06 +0200, Nicolas wrote: > Hello! > > I tried to parse utf8 .xml files with the sample program > example/sax_parser/ (i've tried with both 2.20 and 2.23 versions). The > program crash during the execution at the position of the first utf8 > char with the following message : "terminate called after throwing an > instance of 'Glib::ConvertError' > 20 Abandon (core dumped)" In C++ you need to catch exceptions to prevent crashes. And you need to find out what part of your code caused an exception to be thrown. Are you using std::cout? std::cout does not understand UTF-8, so Glib::ustring tries to convert first. Have you tried your XML document with one of the libxml++ examples? -- mu...@mu... www.murrayc.com www.openismus.com |
From: Nicolas <ni...@pi...> - 2008-05-03 20:07:09
|
Hello! I tried to parse utf8 .xml files with the sample program example/sax_parser/ (i've tried with both 2.20 and 2.23 versions). The program crash during the execution at the position of the first utf8 char with the following message : "terminate called after throwing an instance of 'Glib::ConvertError' 20 Abandon (core dumped)" for exemple here is the result output for the parsing of http://packs.shtooka.net/chi-balm-hsk1/ogg/index.xml ------------- on_start_document() node name=index on_characters(): node name=group Attribute swac_lang = chi Attribute swac_speak_name = Wei Gao Attribute swac_speak_gender = M Attribute swac_speak_birth_year = 1979 Attribute swac_speak_lang = chi Attribute swac_speak_lang_country = CH Attribute swac_speak_lang_region = Pekin Attribute swac_speak_liv_country = CH Attribute swac_speak_liv_town = Pekin Attribute swac_pron_speed = 1 Attribute swac_coll_name = Base Audio Libre de Mots Chinois Attribute swac_coll_section = HSK 1 Attribute swac_coll_desc = terminate called after throwing an instance of 'Glib::ConvertError' Abandon (core dumped) (There is a the following content header at the begining of the xml file : <?xml version="1.0" encoding="UTF-8"?>) What could I do to solve the problem? Regards, Nicolas |
From: Murray C. <mu...@mu...> - 2008-03-27 12:37:50
|
On Tue, 2008-03-25 at 23:09 -0300, Ignacio Espinosa wrote: > El mar, 18-03-2008 a las 11:54 -0300, Ignacio Espinosa escribió: > > El mar, 18-03-2008 a las 12:59 +0100, Murray Cumming escribió: > > > > > > That shouldn't be necessary. Could you add a simple-as-possible test > > > case to bugzilla? > > > > > Done: http://bugzilla.gnome.org/show_bug.cgi?id=523187 > > > > Thanks for the answer :) > > > If the original document it's as simple as decribed in bugtrack, this > procedure (based on dom_parser example) will fix the problem (not > bug :P): > > void clean_document (xmlpp::Node* node) > { > xmlpp::ContentNode* nodeContent = > dynamic_cast<xmlpp::ContentNode*>(node); > xmlpp::TextNode* nodeText = dynamic_cast<xmlpp::TextNode*>(node); > > if(nodeText && nodeText->is_white_space()) > { > xmlpp::Element *parent_e = node->get_parent(); > xmlpp::Node *parent_n = dynamic_cast<xmlpp::Node*>(parent_e); > parent_n->remove_child(node); > return; > } > > if(!nodeContent) > { > xmlpp::Node::NodeList list = node->get_children(); > for(xmlpp::Node::NodeList::iterator iter = list.begin(); iter != > list.end(); ++iter) > clean_document(*iter); > } > } That seems to just remove formatting. I created this little highly-inefficient add_indenting_white_space_to_node() function in Bakery to correct or add indentation. It works for Glom, at least: http://svn.gnome.org/viewvc/bakery/trunk/bakery/Document/Document_XML.cc?revision=108&view=markup Here is the current code for that function from svn: void Document_XML::add_indenting_white_space_to_node(xmlpp::Node* node, const Glib::ustring& start_indent) { if(!node) node = get_node_document(); //Remove any previous indenting: { xmlpp::Node::NodeList list = node->get_children(); for(xmlpp::Node::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) { xmlpp::Node* child = *iter; if(!child) continue; xmlpp::ContentNode* text = dynamic_cast<xmlpp::ContentNode*>(child); if(text) { if(text->is_white_space()) node->remove_child(text); } } } //All indents have a newline, //and we add spaces each time we recurse: Glib::ustring indent = start_indent; if(indent.empty()) indent = "\n "; else indent += " "; //Add indenting text items: bool had_children = false; xmlpp::Element* node_as_element = dynamic_cast<xmlpp::Element*>(node); xmlpp::Node::NodeList list = node_as_element->get_children(); for(xmlpp::Node::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) { xmlpp::Node* child = *iter; if(!child) continue; xmlpp::ContentNode* text = dynamic_cast<xmlpp::ContentNode*>(child); if(text) { if(!text->is_white_space()) continue; //Don't change content items. } //Add a text item for the indenting, before the child: //std::cout << " Adding indent after node=" << child->get_name() << ": START" << indent << "END" << std::endl; node_as_element->add_child_text_before(child, indent); had_children = true; //Recurse into the children: add_indenting_white_space_to_node(child, indent); } //If it has children then add an indent before the closing tag: if(had_children) node_as_element->add_child_text(start_indent); } -- mu...@mu... www.murrayc.com www.openismus.com |
From: <Luk...@dl...> - 2008-03-25 16:16:07
|
Hello there I have just recompiled my code against the latest gtkmm libs on WIN32 and on linux and I was confused to see it crash. The segfault occures when ever an exception should be thrown. Please explain what the idea behind the usage of the --enable-api-exceptions flag is (which was disabled for my binary release). Regards |
From: Fabian J. <fab...@gm...> - 2008-03-19 08:30:59
|
Hi all, I can't distribute my software with libxml++ and dependences in DLL's. Maybe some of you know a distribution of all of this in static libraries win32. The second solution is to recompile by my self. I tried this and had a problem with zlib (can't compile asm with VS2005) and I don't find sources of intl.dll If some body can help me. Thank you. |
From: 馮所範 <fe...@dh...> - 2008-03-19 00:40:52
|
Hi Minggi The following is my opinion. As you don't have any DTD in your string so you Don't need to any validation. Change your code to this: lParser.set_validate(false); As lParser.set_validate(); is equal to lParser.set_validate(true); and try again . Hope it work. Have a good day! -----Original Message----- From: lib...@li... [mailto:lib...@li...] On Behalf Of Stoffel Armin Sent: Tuesday, March 18, 2008 7:51 PM To: lib...@li... Subject: [libxml++] parse_memory Hi all I try to parse a string: lQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><envelope name=\"getSeed\"><body><getSeed/></body></envelope>"; DomParser lParser; lParser.set_validate(); lParser.set_substitute_entities(); lParser.parse_memory(lQuery); lXmlDocRes = lParser.get_document(); It do not work. Can you help? What's wrong? Minggi ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Libxmlplusplus-general mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libxmlplusplus-general |
From: Murray C. <mu...@mu...> - 2008-03-18 11:59:53
|
On Tue, 2008-03-11 at 12:45 -0300, Ignacio Espinosa wrote: > Hi all, > > I'm reading a xml file, adding new nodes and then writting it to another > xml file with write_to_file_formatted, that's when came the problem up. > The result looks like this (only with the new nodes): > > <newnode1><newnode2>text2</newnode2><newnode3>text3</newnode3></newnode1> > > The rest of de file looks just fine. > > I've trying with libxml++2.20 (Debian Testing version) and Libxml++2.22. > > Here is how I added the nodes: > > Element *tmp_elem = root_node->add_child("newnode1"); > Node *tmp_node = dynamic_cast<Node*>(tmp_elem); > > tmp_elem = tmp_node->add_child("newnode2"); > tmp_elem->set_child_text("newtext2"); > tmp_elem = tmp_node->add_child("newnode3"); > tmp_elem->set_child_text("newtext3"); > > --- > I don't know if I'm doing something wrong, or it's some libxml++ or > libxml (xmlSaveFormatFileEnc) bug. > > How can I fix this problem? Do I have to manually insert whitespaces? That shouldn't be necessary. Could you add a simple-as-possible test case to bugzilla? -- mu...@mu... www.murrayc.com www.openismus.com |
From: Stoffel A. <ar...@to...> - 2008-03-18 11:50:58
|
Hi all I try to parse a string: lQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><envelope name=\"getSeed\"><body><getSeed/></body></envelope>"; DomParser lParser; lParser.set_validate(); lParser.set_substitute_entities(); lParser.parse_memory(lQuery); lXmlDocRes = lParser.get_document(); It do not work. Can you help? What's wrong? Minggi |
From: Ignacio E. <ies...@gr...> - 2008-03-11 15:44:10
|
Hi all, I'm reading a xml file, adding new nodes and then writting it to another xml file with write_to_file_formatted, that's when came the problem up. The result looks like this (only with the new nodes): <newnode1><newnode2>text2</newnode2><newnode3>text3</newnode3></newnode1> The rest of de file looks just fine. I've trying with libxml++2.20 (Debian Testing version) and Libxml++2.22. Here is how I added the nodes: Element *tmp_elem = root_node->add_child("newnode1"); Node *tmp_node = dynamic_cast<Node*>(tmp_elem); tmp_elem = tmp_node->add_child("newnode2"); tmp_elem->set_child_text("newtext2"); tmp_elem = tmp_node->add_child("newnode3"); tmp_elem->set_child_text("newtext3"); --- I don't know if I'm doing something wrong, or it's some libxml++ or libxml (xmlSaveFormatFileEnc) bug. How can I fix this problem? Do I have to manually insert whitespaces? Thanks ignacio. |
From: dexter <de...@ba...> - 2008-01-30 10:48:09
|
Hi! First of all, I think you slightly misunderstood what i wrote. 1. I'm aware of that I don't have DTD in my xml. I have a very good reason for that. Namely, I don't need it. I'll do the validation with a schema and not with DTD. (I also know that libxml++ doesn't contain a wrapper to do that, but i've already applied Emilien KIA's patch, so now it is capable to do validation with schemas) 2. The problem is not with the validation (It does not even get there). The problem is that the xml is _not_ well formed. And what I would like is to get the error somehow in my program, but instead it just writes error messages to the console. Of course I use exceptions as you wrote, and I catch everything at the end [catch (...)], but this error cannot be catched because - as i noticed - it doesn't raise an exception. With the method I mentioned in my previous mail, I'm able to catch those error, but I thougth - maybe - there's a simplier way to do that. I hope it's more clear now. -- Balazs > ----- Original Message ----- > From: Glück Attila Béla <glu...@gm...> > To: lib...@li... > Sent: Wed, Jan 30, 2008 8:04:56 AM +0100 > Subject: [libxml++] parser problem > > Hi Balazs! > > First: You don't have DTD in your xml. libxml++ can read it from your > xml, or from an another file: > <?xml version="1.0"?> > <!DOCTYPE settings SYSTEM "myxml.dtd"> > You can't validate your xml with the DomParser without a correct DTD. > > Second: You need catch the exceptions. > Something like this: > try { > conf->load_general_settings("general.xml"); > } catch (xmlpp::internal_error& ex) { > Gtk::MessageDialog dlg(_("Internal error in the xml > parser!"),false, Gtk::MESSAGE_ERROR,Gtk::BUTTONS_OK); > dlg.set_secondary_text(ex.what()); dlg.run(); > return -1; > } catch (xmlpp::validity_error& ex) { > ... > } catch (xmlpp::exception& ex) { > Gtk::MessageDialog dlg(_("Error in the xml parser!"),false, > Gtk::MESSAGE_ERROR,Gtk::BUTTONS_OK); > dlg.set_secondary_text(ex.what()); > dlg.run(); > return -1; > } > > In this program I should not work with the bad xml, but sometimes > it possible. In this case you need only a try-catch block in > your code at the read, and it will work fine. But don't forget send a > message to the user. Much easier to correct the bug in the xml, if > you know, it is there. > If you have problem with the validation, you can switch it of, > and force the reading. > Something like this: > > void read_from_xml(const char* file, bool validation=true) > { > xmlpp::DomParser parser; > parser.set_validate(validation); > parser.parse_file(file); > .. > } > > try { > read_from_xml("myxml.xml"); > } catch (xmlpp::validity_error& ex) { > log.add_warning("myxml validation failed!"); > read_from_xml("myxml.xml",false); > } > > Attila > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Libxmlplusplus-general mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libxmlplusplus-general > |
From:
<glu...@gm...> - 2008-01-30 07:05:30
|
Hi Balazs! First: You don't have DTD in your xml. libxml++ can read it from your xml, or from an another file: <?xml version="1.0"?> <!DOCTYPE settings SYSTEM "myxml.dtd"> You can't validate your xml with the DomParser without a correct DTD. Second: You need catch the exceptions. Something like this: try { conf->load_general_settings("general.xml"); } catch (xmlpp::internal_error& ex) { Gtk::MessageDialog dlg(_("Internal error in the xml parser!"),false, Gtk::MESSAGE_ERROR,Gtk::BUTTONS_OK); dlg.set_secondary_text(ex.what()); dlg.run(); return -1; } catch (xmlpp::validity_error& ex) { ... } catch (xmlpp::exception& ex) { Gtk::MessageDialog dlg(_("Error in the xml parser!"),false, Gtk::MESSAGE_ERROR,Gtk::BUTTONS_OK); dlg.set_secondary_text(ex.what()); dlg.run(); return -1; } In this program I should not work with the bad xml, but sometimes it possible. In this case you need only a try-catch block in your code at the read, and it will work fine. But don't forget send a message to the user. Much easier to correct the bug in the xml, if you know, it is there. If you have problem with the validation, you can switch it of, and force the reading. Something like this: void read_from_xml(const char* file, bool validation=true) { xmlpp::DomParser parser; parser.set_validate(validation); parser.parse_file(file); ... } try { read_from_xml("myxml.xml"); } catch (xmlpp::validity_error& ex) { log.add_warning("myxml validation failed!"); read_from_xml("myxml.xml",false); } Attila |
From: Balazs T. <de...@ba...> - 2008-01-29 11:01:49
|
Hi! I'm using libxml++ to parse an xml file like this: . . xmlpp::DomParser parser; parser.set_validate(true); parser.parse_file("example.xml"); . . The example.xml file looks like this: <?xml version="1.0"?> <!-- Example from XMLSchema recommendation 0 - primer at http://www.w3.org/TR/xmlschema-0/ --> <purchaseOrder orderDate="1999-10-20"> <shipTo country="US"> <nme>Alice Smith</name> . . . and as you can see it contains an error at "<nme>Alice Smith</name>", that's fine. Now.. when i'm running the program, i got this on the console: example.xml:5: parser error : Opening and ending tag mismatch: nme line 5 and name <nme>Alice Smith</name> ^ Which is - of course - OK, because it really contains errors, but i cannot control this error message with libxml++. I mean i got an exception whit this message: "Validity error:Validation failed: no DTD found !" but I can't get anything else. So what I want is that "opening and ending tag mismatch..." message do not appear on the console, instead I should control what should appear and what is not. Is there a simple way to do that in libxmlpp? (I found a function in libxml called: xmlSetStructuredErrorFunc. When i use this function to set a callback, then it does exactly what i want. It does not send anything to the console instead it calls that callback function with the error message, and i can decide what i want to do that message.) |
From: <fe...@dh...> - 2007-12-26 05:52:42
|
Hi I have written a C++ dll in XP with VS2005 . And I want to use this dll in Windows NT4.0. The following shows how I did and what problem I met. 1. This dll used libxml++(version 2.6.30) and glibmm(version 2.4), and I used "MT" option to compile this dll to package all the relative libs(such as MSVCRT80.dll and so on) to this dll(or lib). The compile result showed no error happened . 2. I moved the compile result(the dll and the lib) to Windows NT4.0 and used it in an application. Compile was ok but when I run the application, it just showed me couldn't find "MSVCR80.dll" . When I copied "MSVCR80.dll" to Windows NT4.0 it just showed me another error : "GetLongPathNameW is not found from KERNEL32.dll" what does libxml++ need, if I want it run on windows NT4.0? What I need to do to solve this problem? Anyone who knows the answer? Thanks in advance! |
From: Murray C. <mu...@mu...> - 2007-12-05 02:26:47
|
On Thu, 2007-11-29 at 12:48 +0000, Hugo Mills wrote: > I've created a minimal test case showing the problem, available > from [1]. The test.sh script may need to be tweaked, depending on > where your libs are. > > Hugo. > > [1] http://www.darksatanic.net/test-case.tar.gz I guess you need to more precisely identify what part of the code is throwing the exception. For instance, this use of the standard C++ streams Glib::ustring utfline(buffer); std::cerr << utfline << std::flush; is likely to throw an exception. The standard C++ streams do not understand UTF-8, so ustring does a conversion when you try to put a ustring in a stream. That conversion can fail. -- mu...@mu... www.murrayc.com www.openismus.com |