From lshen at cisco.com Wed Mar 3 20:37:39 2004 From: lshen at cisco.com (Shen, Lin) Date: Wed Mar 3 20:39:05 2004 Subject: [Expat-discuss] XML generator Message-ID: <6677B3346233B94EBB11C0609351012001FC89FC@vtg-um-e2k1.sj21ad.cisco.com> Hi, Where can I find an XML generator? All I need is to generate XML documents according to a given DTD. Thanks lin From esilva at mobicomp.com Thu Mar 4 05:12:26 2004 From: esilva at mobicomp.com (Ernesto Silva) Date: Thu Mar 4 09:30:38 2004 Subject: [Expat-discuss] XML generator References: <6677B3346233B94EBB11C0609351012001FC89FC@vtg-um-e2k1.sj21ad.cisco.com> Message-ID: <008701c401d1$3293dbc0$1100a8c0@EmpS> Hi, Why you don't use Altova Xml Spy? Ernesto Silva ----- Original Message ----- From: "Shen, Lin" To: Sent: Thursday, March 04, 2004 1:37 AM Subject: [Expat-discuss] XML generator Hi, Where can I find an XML generator? All I need is to generate XML documents according to a given DTD. Thanks lin _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From lshen at cisco.com Thu Mar 4 13:23:46 2004 From: lshen at cisco.com (Shen, Lin) Date: Thu Mar 4 13:25:14 2004 Subject: [Expat-discuss] XML generator Message-ID: <6677B3346233B94EBB11C0609351012001FC89FD@vtg-um-e2k1.sj21ad.cisco.com> I guess I didn't make it clear in my last email. I'm NOT looking for a standalone tool. What I want is something that can be used in an embedded environment and provides a set of APIs to the rest of the system to generate XML documents on fly. Thanks lin > -----Original Message----- > From: Ernesto Silva [mailto:esilva@mobicomp.com] > Sent: Thursday, March 04, 2004 2:12 AM > To: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] XML generator > > > Hi, > > Why you don't use Altova Xml Spy? > > > Ernesto Silva > > > ----- Original Message ----- > From: "Shen, Lin" > To: > Sent: Thursday, March 04, 2004 1:37 AM > Subject: [Expat-discuss] XML generator > > > Hi, > > Where can I find an XML generator? All I need is to generate > XML documents according to a given DTD. > > Thanks > lin > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expa> t-discuss > > > > > _______________________________________________ > > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expa> t-discuss > From vishal at absiweb.com Thu Mar 4 13:32:37 2004 From: vishal at absiweb.com (Vishal Anand) Date: Thu Mar 4 13:32:43 2004 Subject: [Expat-discuss] XML generator In-Reply-To: <6677B3346233B94EBB11C0609351012001FC89FD@vtg-um-e2k1.sj21ad.cisco.com> Message-ID: <002101c40217$117cc730$3908020a@absiweb.com> Go to this link: http://www.w3.org/XML/Schema , u will find lots of tools to generate XML document from DTD. Regards, Vishal -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org] On Behalf Of Shen, Lin Sent: Thursday, March 04, 2004 1:24 PM To: Ernesto Silva; expat-discuss@libexpat.org Subject: RE: [Expat-discuss] XML generator I guess I didn't make it clear in my last email. I'm NOT looking for a standalone tool. What I want is something that can be used in an embedded environment and provides a set of APIs to the rest of the system to generate XML documents on fly. Thanks lin > -----Original Message----- > From: Ernesto Silva [mailto:esilva@mobicomp.com] > Sent: Thursday, March 04, 2004 2:12 AM > To: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] XML generator > > > Hi, > > Why you don't use Altova Xml Spy? > > > Ernesto Silva > > > ----- Original Message ----- > From: "Shen, Lin" > To: > Sent: Thursday, March 04, 2004 1:37 AM > Subject: [Expat-discuss] XML generator > > > Hi, > > Where can I find an XML generator? All I need is to generate > XML documents according to a given DTD. > > Thanks > lin > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expa> t-discuss > > > > > _______________________________________________ > > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expa> t-discuss > _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From franz at trispen.com Tue Mar 9 09:52:57 2004 From: franz at trispen.com (Franz Struwig) Date: Tue Mar 9 09:53:10 2004 Subject: [Expat-discuss] Beginner trying to create XML file Message-ID: <003401c405e6$35aec680$ce9207c4@trispen.com> Greetings, Using the online guide, I've been able to extract information from an xml file using expat. Excuse my complete newbyism, but how do you create an xml file using expat? I couldn't find any examples. Any example code would be greatly appreciated! Thanks. From regis.st-gelais at laubrass.com Tue Mar 9 10:13:35 2004 From: regis.st-gelais at laubrass.com (=?iso-8859-1?Q?R=E9gis_St-Gelais?=) Date: Tue Mar 9 10:16:37 2004 Subject: [Expat-discuss] Beginner trying to create XML file References: <003401c405e6$35aec680$ce9207c4@trispen.com> Message-ID: <028a01c405e9$17ad51d0$647ba8c0@regis> ----- Original Message ----- From: Franz Struwig To: expat-discuss@libexpat.org Sent: Tuesday, March 09, 2004 9:52 AM Subject: [Expat-discuss] Beginner trying to create XML file >Greetings, >Using the online guide, I've been able to extract information from an xml file using expat. > >Excuse my complete newbyism, but how do you create an xml file using expat? I couldn't find any >examples. Expat is a parser, it only reads XML files, it does not write. In my case a generate my XML files manualy using fprintf Regis From fdrake at acm.org Tue Mar 9 10:18:56 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Mar 9 10:19:09 2004 Subject: [Expat-discuss] Beginner trying to create XML file In-Reply-To: <003401c405e6$35aec680$ce9207c4@trispen.com> References: <003401c405e6$35aec680$ce9207c4@trispen.com> Message-ID: <200403091018.59040.fdrake@acm.org> On Tuesday 09 March 2004 09:52 am, Franz Struwig wrote: > Excuse my complete newbyism, but how do you create an xml file using > expat? I couldn't find any examples. Expat is an XML parser and does not deal with generation of XML at all. I think many people simply use whatever form of print statement is available in their chosen language (Expat is used from many), or, for more complicated systems, select a separate library for generating XML. There's not much that's shared between XML parsing and XML generation, so there's little incentive to combine the two for low-level libraries like Expat. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From jcg at belbone.be Thu Mar 11 10:38:50 2004 From: jcg at belbone.be (jcg) Date: Thu Mar 11 10:37:43 2004 Subject: [Expat-discuss] How can I use the first parameter of my start handler (void * data) ? Message-ID: <1079019530.21611.17.camel@localhost> I'm not good at all with this parser. QUESTION How can I use the first parameter of my start handler (void * data) ? eg static void XMLCALL start_connector(void *data, const char *el, const char **attr) Thanks to reply. GOLDBERG From Greg.Martin at TELUS.COM Thu Mar 11 10:48:56 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Thu Mar 11 10:48:57 2004 Subject: [Expat-discuss] How can I use the first parameter of my starthandler (void * data) ? Message-ID: You can use XML_SetUserData and XML_GetUserData to pass a pointer and store data for later use. You might want to create a list of data elements or build a document tree. The object pointed to by the void * in XML_SetUserData will be passed to your handlers. When parsing is complete you can retrieve it with XML_GetUserData. I use C++ and often encapsulate my handlers as static class methods. By passing a pointer to the class I can have interaction between my handlers. Greg. -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of jcg Sent: Thursday, March 11, 2004 8:39 AM To: expat-discuss@libexpat.org Subject: [Expat-discuss] How can I use the first parameter of my starthandler (void * data) ? I'm not good at all with this parser. QUESTION How can I use the first parameter of my start handler (void * data) ? eg static void XMLCALL start_connector(void *data, const char *el, const char **attr) Thanks to reply. GOLDBERG _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From jcg at belbone.be Thu Mar 11 11:05:25 2004 From: jcg at belbone.be (jcg) Date: Thu Mar 11 11:04:15 2004 Subject: [Expat-discuss] How can I use the first parameter of my starthandler (void * data) ? In-Reply-To: References: Message-ID: <1079021125.21605.22.camel@localhost> Ok, it is fine. But what kind of information I can read ? In fact the idea is only to get from an XML file all the attributes and not only the first level attributes (when I copy the examples on internet) ! Thanks to reply REGARDS On Thu, 2004-03-11 at 16:48, Greg Martin wrote: > You can use XML_SetUserData and XML_GetUserData to pass a pointer and store data for later use. You might want to create a list of data elements or build a document tree. The object pointed to by the void * in XML_SetUserData will be passed to your handlers. When parsing is complete you can retrieve > it with XML_GetUserData. I use C++ and often encapsulate my handlers as static class methods. By passing a pointer to the class I can have interaction between my handlers. > Greg. > > > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of jcg > Sent: Thursday, March 11, 2004 8:39 AM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] How can I use the first parameter of my > starthandler (void * data) ? > > > I'm not good at all with this parser. > > QUESTION > How can I use the first parameter of my start handler (void * data) ? > eg > static void XMLCALL start_connector(void *data, const char *el, const > char **attr) > > Thanks to reply. > GOLDBERG > > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > > > From Greg.Martin at TELUS.COM Thu Mar 11 11:58:53 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Thu Mar 11 11:58:55 2004 Subject: [Expat-discuss] How can I use the first parameter of mystarthandler (void * data) ? Message-ID: Attributes are paired and the list is NULL terminated. If you increment char **attributes until it is zero you will get the attributes for the element (name then value). Off the top of my head, in brief in C++: struct attribs { std::string name; std::string value; }; std::vector *vdata = new std::vector; void my_handler(void *data, const char *el, const char **attrib) { std::vector *vdata = (std::vector *)data; for(int i = 0; attrib[i]; i += 2) { struct attribs *next = malloc(sizeof struct attribs); next->name = attrib[i]; next->value = attrib[i + 1]; vdata.push_back(next); } } XML_Parser theParser = XML_ParserCreate(0); XML_SetStartElementHandler(theParser, my_handler); XML_SetUserData(theParser, vdata); fopen("something.xml", "r"); for(;;) { int done; char buff[BUFFSIZE]; int len = fread(buff, 1, BUFFSIZE, fp); done = feof(fp); XML_Parse(theParser, buff, len, done); if(done) break; } std::vector *ret = XML_GetUserData(theParser); -----Original Message----- From: jcg [mailto:jcg@belbone.be] Sent: Thursday, March 11, 2004 9:05 AM To: Greg Martin Cc: expat-discuss@libexpat.org Subject: RE: [Expat-discuss] How can I use the first parameter of mystarthandler (void * data) ? Ok, it is fine. But what kind of information I can read ? In fact the idea is only to get from an XML file all the attributes and not only the first level attributes (when I copy the examples on internet) ! Thanks to reply REGARDS On Thu, 2004-03-11 at 16:48, Greg Martin wrote: > You can use XML_SetUserData and XML_GetUserData to pass a pointer and store data for later use. You might want to create a list of data elements or build a document tree. The object pointed to by the void * in XML_SetUserData will be passed to your handlers. When parsing is complete you can retrieve > it with XML_GetUserData. I use C++ and often encapsulate my handlers as static class methods. By passing a pointer to the class I can have interaction between my handlers. > Greg. > > > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of jcg > Sent: Thursday, March 11, 2004 8:39 AM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] How can I use the first parameter of my > starthandler (void * data) ? > > > I'm not good at all with this parser. > > QUESTION > How can I use the first parameter of my start handler (void * data) ? > eg > static void XMLCALL start_connector(void *data, const char *el, const > char **attr) > > Thanks to reply. > GOLDBERG > > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > > > From karl at waclawek.net Mon Mar 15 10:26:37 2004 From: karl at waclawek.net (Karl Waclawek) Date: Mon Mar 15 10:26:43 2004 Subject: [Expat-discuss] API change seems necessary for 1.95.8 Message-ID: <003d01c40aa1$e893f6c0$9e539696@citkwaclaww2k> In the (not yet officially released) suspend/resume API for Expat 1.95.8 I ran into a portability problem. It seems that the handling of return values is not well-defined and very compiler specific even between compilers on Windows/Intel. Specifically: XMLPARSEAPI(XML_ParsingStatus) XML_GetParsingStatus(XML_Parser parser); returns a struct larger than 4 bytes. As far as I can tell, the usual calling conventions (cdecl, stdcall, etc.) do not have a definition for how return values are be handled, especially for anything larger than an integer. MS VC++ uses the EDX:EAX register pair for an 8 byte struct, Delphi uses a pointer passed as first parameter (both having cdecl specified!). So, in the interest of portability I would like to change the signature above to: XMLPARSEAPI(void) XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus * status); Any objections? Is this a common or well known problem? Karl From weigelt at metux.de Mon Mar 15 23:46:26 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Mon Mar 15 23:47:44 2004 Subject: [Expat-discuss] building libexpat Message-ID: <20040316044625.GA1400@nibiru.metux.de> Hi folks, i've got some questions about how to build libexpat under this conditions: a) fetch all libraries and includes from some prefix b) install all files to some prefix (but _NOT_ affecting the runtime locations) c) select the components to install (libs, includes, static libs, docs/man of certain language) I need these things for me system builder, which should build whole optimized distros. cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From weigelt at metux.de Mon Mar 15 23:54:51 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Mon Mar 15 23:57:29 2004 Subject: [Expat-discuss] automatic release notification Message-ID: <20040316045451.GB1400@nibiru.metux.de> Hi folks, is there any automatic release notification system, which I could use for feeding my package builder robots (i.e. machine readable mail announcements) ? For my buildfarm system I need for each package: + version + matuarity level + url(s) for downloading + dependencies + provided interfaces + optional features (w/ dependencies + interfaces) Is something in this direction available ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From fdrake at acm.org Tue Mar 16 10:08:07 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Mar 16 10:08:20 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <20040316045451.GB1400@nibiru.metux.de> References: <20040316045451.GB1400@nibiru.metux.de> Message-ID: <200403161008.07984.fdrake@acm.org> On Monday 15 March 2004 11:54 pm, Enrico Weigelt wrote: > is there any automatic release notification system, which I could > use for feeding my package builder robots (i.e. machine readable > mail announcements) ? > > For my buildfarm system I need for each package: > + version > + matuarity level > + url(s) for downloading > + dependencies > + provided interfaces > + optional features (w/ dependencies + interfaces) You can sign up to "monitor" file releases via SourceForge. Since we use the SF release system, that will provide as automagical an email as you'll get. I don't know how machine-parsable those are, and don't expect that all the information you want will be conveniently encoded for most projects anyway. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From weigelt at metux.de Tue Mar 16 10:10:40 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Tue Mar 16 10:13:46 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <200403161008.07984.fdrake@acm.org> References: <20040316045451.GB1400@nibiru.metux.de> <200403161008.07984.fdrake@acm.org> Message-ID: <20040316151039.GB24953@nibiru.metux.de> * Fred L. Drake, Jr. [2004-03-16 10:08:07 -0500]: > You can sign up to "monitor" file releases via SourceForge. > Since we use the SF release system, that will provide as > automagical an email as you'll get. Ah, I'll try it. > I don't know how machine-parsable those are, and don't expect that all the > information you want will be conveniently encoded for most projects anyway. hmm, well, they generate them by machine, so it usally should have a quite consistent format. thx -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From weigelt at metux.de Tue Mar 16 10:45:30 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Tue Mar 16 10:47:35 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <20040316151039.GB24953@nibiru.metux.de> References: <20040316045451.GB1400@nibiru.metux.de> <200403161008.07984.fdrake@acm.org> <20040316151039.GB24953@nibiru.metux.de> Message-ID: <20040316154529.GA6620@nibiru.metux.de> * Enrico Weigelt [2004-03-16 15:10:40 +0000]: > > You can sign up to "monitor" file releases via SourceForge. > > Since we use the SF release system, that will provide as > > automagical an email as you'll get. > Ah, I'll try it. hmm, well, perhaps I'm just to stupid, but I can't find this anywhere. could anyone help please ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From fdrake at acm.org Tue Mar 16 11:11:07 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Mar 16 11:11:25 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <20040316154529.GA6620@nibiru.metux.de> References: <20040316045451.GB1400@nibiru.metux.de> <20040316151039.GB24953@nibiru.metux.de> <20040316154529.GA6620@nibiru.metux.de> Message-ID: <200403161111.07032.fdrake@acm.org> On Tuesday 16 March 2004 10:45 am, Enrico Weigelt wrote: > hmm, well, perhaps I'm just to stupid, but I can't find this anywhere. > > could anyone help please ? Hmm, this is interesting, to say the least. There used to be a "Monitor" button similar to that found in the trackers to allow monitoring of individual issues, but I don't see it now. The interface for the admin side of the release system still has a way to send the notification. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From weigelt at metux.de Tue Mar 16 13:02:35 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Tue Mar 16 13:04:45 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <200403161111.07032.fdrake@acm.org> References: <20040316045451.GB1400@nibiru.metux.de> <20040316151039.GB24953@nibiru.metux.de> <20040316154529.GA6620@nibiru.metux.de> <200403161111.07032.fdrake@acm.org> Message-ID: <20040316180235.GB7785@nibiru.metux.de> * Fred L. Drake, Jr. [2004-03-16 11:11:07 -0500]: > On Tuesday 16 March 2004 10:45 am, Enrico Weigelt wrote: > > hmm, well, perhaps I'm just to stupid, but I can't find this anywhere. > > > > could anyone help please ? > > Hmm, this is interesting, to say the least. There used to be a "Monitor" > button similar to that found in the trackers to allow monitoring of > individual issues, but I don't see it now. The interface for the admin side > of the release system still has a way to send the notification. hmmpf! would the project admin be so kind an post out such machine readable notifications until we've got the sf-monitor running ? btw: I've asked SF several times if there's a way for doing automated released w/o having to go over the webfrontend, i.e. simply uploading the release files and a description file or sth like that. but up today no answer :( cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From gstein at lyra.org Tue Mar 16 15:28:00 2004 From: gstein at lyra.org (Greg Stein) Date: Tue Mar 16 15:25:53 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <200403161111.07032.fdrake@acm.org>; from fdrake@acm.org on Tue, Mar 16, 2004 at 11:11:07AM -0500 References: <20040316045451.GB1400@nibiru.metux.de> <20040316151039.GB24953@nibiru.metux.de> <20040316154529.GA6620@nibiru.metux.de> <200403161111.07032.fdrake@acm.org> Message-ID: <20040316122800.A29086@lyra.org> On Tue, Mar 16, 2004 at 11:11:07AM -0500, Fred L. Drake, Jr. wrote: > On Tuesday 16 March 2004 10:45 am, Enrico Weigelt wrote: > > hmm, well, perhaps I'm just to stupid, but I can't find this anywhere. > > > > could anyone help please ? > > Hmm, this is interesting, to say the least. There used to be a "Monitor" > button similar to that found in the trackers to allow monitoring of > individual issues, but I don't see it now. Looks like it was moved into the "premium" SourceForge service: http://sourceforge.net/subscription.php Cheers, -g -- Greg Stein, http://www.lyra.org/ From fdrake at acm.org Tue Mar 16 15:34:21 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Mar 16 15:34:40 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <20040316122800.A29086@lyra.org> References: <20040316045451.GB1400@nibiru.metux.de> <200403161111.07032.fdrake@acm.org> <20040316122800.A29086@lyra.org> Message-ID: <200403161534.21130.fdrake@acm.org> On Tuesday 16 March 2004 03:28 pm, Greg Stein wrote: > Looks like it was moved into the "premium" SourceForge service: > > http://sourceforge.net/subscription.php That's not actually clear there, though it would sadden me. Tracker monitoring, for instance, is still available for everyone. Of course, it's also not clear that it *wasn't* made part of the premium service. ;-( -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From weigelt at metux.de Wed Mar 17 17:29:46 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Wed Mar 17 17:36:59 2004 Subject: [Expat-discuss] automatic release notification In-Reply-To: <200403161534.21130.fdrake@acm.org> References: <20040316045451.GB1400@nibiru.metux.de> <200403161111.07032.fdrake@acm.org> <20040316122800.A29086@lyra.org> <200403161534.21130.fdrake@acm.org> Message-ID: <20040317222946.GA14530@nibiru.metux.de> * Fred L. Drake, Jr. [2004-03-16 15:34:21 -0500]: > On Tuesday 16 March 2004 03:28 pm, Greg Stein wrote: > > Looks like it was moved into the "premium" SourceForge service: > > > > http://sourceforge.net/subscription.php > > That's not actually clear there, though it would sadden me. Tracker > monitoring, for instance, is still available for everyone. > > Of course, it's also not clear that it *wasn't* made part of the premium > service. ;-( So, could we do it by ourselves (manually) ? Perhaps such notification could be a simple mail in the form like: == BEGIN PACKAGE RELEASE NOTIFICATION == package: expat branch: stable version: 1.2.3.4 location: ftp://ftp.foo.org/pub/expat/expat-1.2.3.4.tar.bz2 location: http://www.foo.org/expat/expat-1.2.3.4.tar.gz == END PACKAGE RELEASE NOTIFICATION == cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From agandfr at yahoo.com Fri Mar 19 09:40:04 2004 From: agandfr at yahoo.com (Dean Agan) Date: Thu Mar 25 00:32:04 2004 Subject: [Expat-discuss] Help Message-ID: <20040319144004.49638.qmail@web40020.mail.yahoo.com> Hi! I am trying to compile expat using Bloodshed Dev C++ in a windows environment. Can anybody help me on how to do it? Please? Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam From terrasurfer at knology.net Wed Mar 24 09:55:36 2004 From: terrasurfer at knology.net (terrasurfer@knology.net) Date: Thu Mar 25 00:32:05 2004 Subject: [Expat-discuss] Multi-Threading in Expat Message-ID: <20040324145536.14935.qmail@webmail1.knology.net> Need to know if there are any issues using expat in a multi-threaded environment. A coding example of parsing with expat in a multi-threaded environment would be helpful also. I'm working in C++ on Win32. Any help would be greatly appreciated. From weigelt at metux.de Thu Mar 25 03:28:15 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Thu Mar 25 01:37:21 2004 Subject: [Expat-discuss] using mmap() Message-ID: <20040325082815.GA30933@nibiru.metux.de> Hi folks, I didn't have a look at the code, so please excuse my probably naive question: Does expat currently use mmap() to read in the XML source ? There're several studies out there showing thats much faster simply mapping in a file than sequentially reading it. expat could see the whole xml file (even if its very big) as a block of memory and "let a pointer run" over it. Any comments ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From fdrake at acm.org Thu Mar 25 01:41:57 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Thu Mar 25 01:42:12 2004 Subject: [Expat-discuss] using mmap() In-Reply-To: <20040325082815.GA30933@nibiru.metux.de> References: <20040325082815.GA30933@nibiru.metux.de> Message-ID: <200403250141.57132.fdrake@acm.org> On Thursday 25 March 2004 03:28 am, Enrico Weigelt wrote: > Does expat currently use mmap() to read in the XML source ? > There're several studies out there showing thats much faster simply > mapping in a file than sequentially reading it. expat could see > the whole xml file (even if its very big) as a block of memory > and "let a pointer run" over it. Expat avoids dealing with I/O at all by having the application provide the data via the API. The "xmlwf" example application does use mmap() on Unix to load data for the Expat library. mmap() is not available on all platforms (though most modern general purpose platforms have it in some form); the Windows version of mmap() is different from the Unix version even at the API level, so mmap() isn't particularly portable. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From weigelt at metux.de Thu Mar 25 05:49:10 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Thu Mar 25 03:57:26 2004 Subject: [Expat-discuss] using mmap() In-Reply-To: <200403250141.57132.fdrake@acm.org> References: <20040325082815.GA30933@nibiru.metux.de> <200403250141.57132.fdrake@acm.org> Message-ID: <20040325104910.GB585@nibiru.metux.de> * Fred L. Drake, Jr. [2004-03-25 01:41:57 -0500]: > Expat avoids dealing with I/O at all by having the application provide the > data via the API. The "xmlwf" example application does use mmap() on Unix to > load data for the Expat library. Ah, seen it. XML_Parse() accepts a pointer to a buffer. So it already works in-memory only. cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From weigelt at metux.de Thu Mar 25 05:55:52 2004 From: weigelt at metux.de (Enrico Weigelt) Date: Thu Mar 25 03:59:45 2004 Subject: [Expat-discuss] selective build + install Message-ID: <20040325105551.GA30456@nibiru.metux.de> Hi folks, i'm working on an automated packaging system and I've got some questions about selective building of expat: + how can I instruct it to fetch all includes and libs from some prefix (i.e. /foo/) - w/o changing --prefix ? i'd like to build it directly in another system tree, but w/o running that system. (the target system maybe has no compiler, etc) + how to install just some parts or install them into several prefixes: binaries, includes, manpages, etc. thx -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- --------------------------------------------------------------------- From karl at waclawek.net Thu Mar 25 08:53:02 2004 From: karl at waclawek.net (Karl Waclawek) Date: Thu Mar 25 08:53:09 2004 Subject: [Expat-discuss] Multi-Threading in Expat References: <20040324145536.14935.qmail@webmail1.knology.net> Message-ID: <002901c41270$7da9be90$9e539696@citkwaclaww2k> > Need to know if there are any issues using expat in a multi-threaded > environment. A coding example of parsing with expat in a multi-threaded > environment would be helpful also. I'm working in C++ on Win32. Any help > would be greatly appreciated. Expat is not thread safe. As long as you use one parser instance per thread, you are OK. if you want to make call-backs into different threads from one parser instance, you have to take care of synchronization issues yourself. Karl From rolf at pointsman.de Thu Mar 25 09:17:34 2004 From: rolf at pointsman.de (rolf@pointsman.de) Date: Thu Mar 25 09:20:37 2004 Subject: [Expat-discuss] Multi-Threading in Expat In-Reply-To: <002901c41270$7da9be90$9e539696@citkwaclaww2k> Message-ID: <20040325141738.F41CB3F01F@pointsman.pointsman.de> On 25 Mar, Karl Waclawek wrote: > Expat is not thread safe. > As long as you use one parser instance per thread, you are OK. Err... Let us get this straight, to avoid confusion. One could also have several parser instances in one thread (or even non-MT application) in use 'at the same time' in the sense, that every of this parser instance is somewhere in the middle of parsing input and awaiting the next chunk of data (all in a status after an e.g. XML_Parse(parser, buf, len, 0) call) and they work without confusing each other. It's only > if you want to make call-backs into different threads from > one parser instance, you have to take care of synchronization > issues yourself. Right? rolf From karl at waclawek.net Thu Mar 25 10:00:27 2004 From: karl at waclawek.net (Karl Waclawek) Date: Thu Mar 25 10:00:34 2004 Subject: [Expat-discuss] Multi-Threading in Expat References: <20040325141738.F41CB3F01F@pointsman.pointsman.de> Message-ID: <004801c41279$e85bce50$9e539696@citkwaclaww2k> > On 25 Mar, Karl Waclawek wrote: > > Expat is not thread safe. > > As long as you use one parser instance per thread, you are OK. > > Err... Let us get this straight, to avoid confusion. One could also > have several parser instances in one thread (or even non-MT > application) in use 'at the same time' in the sense, that every of > this parser instance is somewhere in the middle of parsing input and > awaiting the next chunk of data (all in a status after an e.g. > XML_Parse(parser, buf, len, 0) call) and they work without confusing > each other. Yes, you are right - bad wording on my part. It should have been: as long as you use a parser instance only from one thread... Karl From janeene at contecint.com.au Mon Mar 29 03:04:02 2004 From: janeene at contecint.com.au (Janeene Webb) Date: Mon Mar 29 03:04:07 2004 Subject: [Expat-discuss] Problem with XML_Parse segmentation fault. Message-ID: <200403291804.02635.janeene@contecint.com.au> Hi, I'm trying to use expat for the first time, so have made and sorted out a lot of dumb mistakes so far. I'm now at the point where I can send to the parser a read in file buffer, but: A. If the buffer array is larger than the read in file, I get a malformed XML error on the line after where the file actually ends, Or B. If the buffer array is smaller than the overall file size, I get a segmentation fault somewhere before the end of the file. It faults at a different point for each buffer size specified, and will fault out on the second pass regardless of the size of the buffer (so if there should have been 4 passes still segfaults on the second). It's probably another error due to not having used expat before, but I'm at a loss as to where to go from here. Any assistance greatly appreciated. The other query I had is how to call the XML_GetCurrentLineNumber function from within the parser's character handler - I haven't been able to work this one out. Cheers, Janeene Webb. Snipped code attached: -------------- next part -------------- A non-text attachment was scrubbed... Name: xml.cc Type: text/x-c++src Size: 2020 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20040329/a02abf93/xml.bin From ejohn at vxindia.veritas.com Mon Mar 29 07:22:28 2004 From: ejohn at vxindia.veritas.com (Erwin) Date: Mon Mar 29 10:32:16 2004 Subject: [Expat-discuss] Is there any API provided by Expat to edit an XML file? Message-ID: I need an xml parser that would allow me to add , modify and delete elements in an XML File. Does Expat provides any API for these operations. Erwin. From fdrake at acm.org Mon Mar 29 10:39:13 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Mon Mar 29 10:39:22 2004 Subject: [Expat-discuss] Is there any API provided by Expat to edit an XML file? In-Reply-To: References: Message-ID: <200403291039.13018.fdrake@acm.org> On Monday 29 March 2004 07:22 am, Erwin wrote: > I need an xml parser that would allow me to add , modify and delete > elements in an XML File. Does Expat provides any API for these operations. No. Expat only supports parsing; it does not provide any in-memory representation of the XML it parses. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From Greg.Martin at TELUS.COM Mon Mar 29 10:40:10 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Mon Mar 29 10:41:48 2004 Subject: [Expat-discuss] Problem with XML_Parse segmentation fault. Message-ID: Hi Janeene. You're redefining buff every time you loop. That could be a problem. There's no way to compile your code without a lot of work and maybe the problem is in code you didn't include. You might want to look at readsome as a more efficient way of doing your read. int length; char buff[BUFFSIZE]; do { length = infile.readsome (buff, BUFFSIZE); done = infile.eof(); ... } while(!done); -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of Janeene Webb Sent: Monday, March 29, 2004 1:04 AM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Problem with XML_Parse segmentation fault. Hi, I'm trying to use expat for the first time, so have made and sorted out a lot of dumb mistakes so far. I'm now at the point where I can send to the parser a read in file buffer, but: A. If the buffer array is larger than the read in file, I get a malformed XML error on the line after where the file actually ends, Or B. If the buffer array is smaller than the overall file size, I get a segmentation fault somewhere before the end of the file. It faults at a different point for each buffer size specified, and will fault out on the second pass regardless of the size of the buffer (so if there should have been 4 passes still segfaults on the second). It's probably another error due to not having used expat before, but I'm at a loss as to where to go from here. Any assistance greatly appreciated. The other query I had is how to call the XML_GetCurrentLineNumber function from within the parser's character handler - I haven't been able to work this one out. Cheers, Janeene Webb. Snipped code attached: From terrasurfer at knology.net Tue Mar 30 15:36:37 2004 From: terrasurfer at knology.net (terrasurfer@knology.net) Date: Tue Mar 30 15:36:41 2004 Subject: [Expat-discuss] cannot convert parameter from 'void (void *, const char *, const char ** )' Message-ID: <20040330203637.26114.qmail@webmail2.knology.net> I am having problems compiling my C++ class using expat. I am running on Windows 2000, using VC++ 6.0 (MS Visual Studio). I have the correct library and include file. I have compiled the example on this platform and also created a multi-threaded example which work fine. The examples didn't use classes. A relevant snippet of the code I'm attempting to compile is below: FUNCTION DEF'N. --------------- int CNode::vLoadCNode(const char *strXMLBuffer) { char buf[BUFSIZ]; XML_Parser parser = XML_ParserCreate(NULL); int done; int depth = 0; XML_SetUserData(parser, &depth); XML_SetElementHandler(parser, _exp_startTagHandler, _exp_endTagHandler); XML_SetCharacterDataHandler(parser,_exp_charDataHandler); do { size_t len = fread(buf, 1, sizeof(buf), (struct _iobuf *)strXMLBuffer); done = len < sizeof(buf); if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { fprintf(stderr, "%s at line %d\n", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser)); return 1; } } while (!done); XML_ParserFree(parser); } HANDLER DECLARATION AND DEFINITION ---------------------------------- void XMLCALL _exp_startTagHandler(void *userData, const char *name, const char **atts); void XMLCALL CNode::_exp_startTagHandler(void *userData, const char *name, const char **atts) { //create a CNode this handler ALWAYS creates a CNode. CNode *newNode = new CNode(); //set the name with the tag name sent to this handler. newNode->vSetName(name); //if something on the stack, set this node as a child of that, //otherwise push this node onto the stack. if(!_tempStack.empty()) { _tempStack[_tempStackCounter]->vAddChild(newNode); _pushNode(newNode); _tempStackCounter++; } else { _pushNode(newNode); _tempStackCounter++; } } COMPILER ERROR: -------------- c:\surfacehums 1.0\code\shums_node\node.cpp(1381) : error C2664: 'XML_SetElementHandler' : cannot convert parameter 2 from 'void (void *,const char *,const char ** )' to 'void (__cdecl *)(void *,const char *,const char ** )' None of the functions with this name in scope match the target type The offending line is in the call to XML_SetElementHandler. I'm not sure if I need to define the function as a function pointer or what? If someone has an idea of what I'm doing wrong it would be greatly appreciated. From karl at waclawek.net Tue Mar 30 16:06:47 2004 From: karl at waclawek.net (Karl Waclawek) Date: Tue Mar 30 16:07:04 2004 Subject: [Expat-discuss] cannot convert parameter from 'void (void *, const char *, const char ** )' References: <20040330203637.26114.qmail@webmail2.knology.net> Message-ID: <004b01c4169a$e9ca2410$9e539696@citkwaclaww2k> > I am having problems compiling my C++ class using expat. I am > running on Windows 2000, using VC++ 6.0 (MS Visual Studio). > I have the correct library and include file. I have compiled the > example on this platform and also created a multi-threaded example which > work fine. The examples didn't use classes. > > void XMLCALL > _exp_startTagHandler(void *userData, const char *name, const char **atts); > void XMLCALL CNode::_exp_startTagHandler(void *userData, const char > *name, const char **atts) Is this an instance method (instead of a static method or global function)? You cannot pass instance methods as call-backs. > > c:\surfacehums 1.0\code\shums_node\node.cpp(1381) : error C2664: > 'XML_SetElementHandler' : cannot convert parameter 2 from 'void (void > *,const char *,const char ** )' to 'void (__cdecl *)(void *,const char > *,const char ** )' > None of the functions with this name in scope match the target type > The error message would indicate that your XMLCALL is not equal to __cdecl. (It is defined in expat.h). Try declaring your call-backs explicitly with __cdecl and see what happens. Karl From Marco.Forberg at gmx.net Tue Mar 30 16:22:35 2004 From: Marco.Forberg at gmx.net (Marco Forberg) Date: Tue Mar 30 16:22:20 2004 Subject: [Expat-discuss] cannot convert parameter from 'void (void *, const char *, const char ** )' In-Reply-To: <20040330203637.26114.qmail@webmail2.knology.net> References: <20040330203637.26114.qmail@webmail2.knology.net> Message-ID: > COMPILER ERROR: > -------------- > c:\surfacehums 1.0\code\shums_node\node.cpp(1381) : error C2664: > 'XML_SetElementHandler' : cannot convert parameter 2 from 'void (void > *,const char *,const char ** )' to 'void (__cdecl *)(void *,const char > *,const char ** )' > None of the functions with this name in scope match the target > type > > > The offending line is in the call to XML_SetElementHandler. I'm not sure > if > I need to define > the function as a function pointer or what? If someone has an idea of > what > I'm doing wrong it would be > greatly appreciated. this error message looks quite familiar to me. you are probably trying to use a class METHOD as handler for expat, which wants a FUNCTION instead. The only way to make expat take your method as handler is to declare it as static, but since static methods don't have access to attributes of your class you have another problem. i solve that problem by setting the userData to the class intself and defining two handlers - a static one and a non static one: class yourClass {public: void handler(char *tag, char **atts); static void handler(void *Data,char *tag,char *atts); }; void yourClass::handler(char *tag, char **atts) {//some useful code } void yourClass::handler(void *Data,char *tag, char **atts) {yourClass *yC = (yourClass *)Data; yC->handler(tag,atts); } Expat will now call your static handler which fill call the non static handler. So you can read the attribute values into some class values or anything else From allan.saywitz at pb.com Wed Mar 31 10:11:21 2004 From: allan.saywitz at pb.com (allan.saywitz@pb.com) Date: Wed Mar 31 10:11:28 2004 Subject: [Expat-discuss] cannot convert parameter from 'void (void *, const char *, const char ** )' Message-ID: If you are using C++, might as well take advantage of inheritence and use a base class to store all the generic code that talks to expat. Then your derived class only needs one handler, not two. Also, you can reuse all the code in your next project by just reusing the base class. Similar to Scott Meyers approach to implementing reference counting of strings by using a base class to do it. See his book "More Effective C++" for details. Included is some working code. Basically it works like this: // Usage: Simple derive a class from XMLExpatParser and override callbacks. // // class MyParser : public XMLExpatParser // { // virtual void startElement(const string& sName, const VectorString& attributes); // virtual void endElement(const string& sName); // virtual void charData(const string& sValue); // } // // MyParser parser; // // if (parser.create()) // { // parser.parse(xmlBuffer, length) // } // // // How it works: // // The *userData which expat maintains is simply a pointer to an instance of your object. // Then the expat callback functions simply call your object's overridden virtual method. // If your object doesn't override a method, the empty method in the base class is called. Hope this helps allan (See attached file: TestExpatParser.zip) -------------- next part -------------- A non-text attachment was scrubbed... Name: TestExpatParser.zip Type: application/zip Size: 6255 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20040331/f8c9729c/TestExpatParser.zip From terrasurfer at knology.net Wed Mar 31 14:56:35 2004 From: terrasurfer at knology.net (terrasurfer@knology.net) Date: Wed Mar 31 14:56:40 2004 Subject: [Expat-discuss] unclosed token at line 1 Message-ID: <20040331195635.28256.qmail@webmail2.knology.net> I am getting this error when I parse xml from a buffer using the XML_Parse() function. On the same data read from a file I don't get the error. My XML is well formed because I can read it in other XML tools. Any ideas why I would get this error from XML_Parse() when reading from a char buffer? Any help is greatly appreciated. From karl at waclawek.net Wed Mar 31 15:00:23 2004 From: karl at waclawek.net (Karl Waclawek) Date: Wed Mar 31 15:00:37 2004 Subject: [Expat-discuss] unclosed token at line 1 References: <20040331195635.28256.qmail@webmail2.knology.net> Message-ID: <007101c4175a$cdd4d730$9e539696@citkwaclaww2k> > I am getting this error when I parse xml from a buffer using the > XML_Parse() function. On the same data read from a file I don't get the > error. My XML is well formed because I can read it in other XML tools. > > Any ideas why I would get this error from XML_Parse() when reading from a > char buffer? Are you including the null terminator? Karl