From rolf@pointsman.de Sun Dec 1 17:34:45 2002 From: rolf@pointsman.de (rolf@pointsman.de) Date: Sun, 1 Dec 2002 18:34:45 +0100 (MET) Subject: [Expat-discuss] clarification In-Reply-To: <200211302131.gAULV1805656@pehoe.civil.ist.utl.pt> Message-ID: <200212011734.SAA20141@pointsman.pointsman.de> On 30 Nov, Carlos Pereira wrote: > According to Simon St. Laurent, XML Elements of Style, > these declarations should both be valid: > > > > > but at least to me Expat seems to require the > version="1.0" attribute, as for example, this > is accepted: > > > > Is Simon wrong? Did the XML specification change? > Could someone comment on this? Hmmm. See the Extensible Markup Language (XML) 1.0 (Second Edition), production 22-24: [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? [23] XMLDecl ::= '' [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') If you have an XMLDecl, then there must be a VersionInfo. I think there isn't much doubt. rolf From fdrake@acm.org Mon Dec 2 14:51:28 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 2 Dec 2002 09:51:28 -0500 Subject: [Expat-discuss] clarification In-Reply-To: <200212011734.SAA20141@pointsman.pointsman.de> References: <200211302131.gAULV1805656@pehoe.civil.ist.utl.pt> <200212011734.SAA20141@pointsman.pointsman.de> Message-ID: <15851.29552.300306.447201@grendel.zope.com> rolf@pointsman.de writes: > If you have an XMLDecl, then there must be a VersionInfo. I think > there isn't much doubt. I would like to note that for external parsed entities, a different production applies: the Text Declaraction (TextDecl) is defined like this: [77] TextDecl ::= '' This cannot be used for the document entity, however. It does allow the form: but not: since the standalone pseudo-attribute is not allowed in this production. Sorry, my copy of Simon's book isn't handy at the moment, so I can't see exactly what he said right now. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From aconchillo at acm.org Tue Dec 3 11:19:18 2002 From: aconchillo at acm.org (Aleix Conchillo Flaque) Date: 03 Dec 2002 12:19:18 +0100 Subject: [Expat-discuss] Simple C Expat Wrapper (SCEW) Message-ID: <878yz79wp5.fsf@klauz.googy.org> hi! i've created a very simple C expat wrapper. the wrapper works in a DOM way instead of the handlers like expat. it first uses the expat handlers to read the xml tree an creates a tree memory structure. it then has functions to retreive elements and attribute from that tree. i did it because i needed to read very simple xml files and did not want to code the handlers each time. i've registered the project in savannah. here is the home page: http://www.nongnu.org/scew/ the library is not yet downloadable, i'm pulishing it. it will be available in a couple of days. but you can still look at an example and the documentation at the home page. it is a first version so, as its name says, it is still very simple. no namespace support for example. i will add more expat functionality in next versions. i hope it will be useful to someone. best regards, aleix From fdrake at acm.org Wed Dec 4 06:59:39 2002 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed, 4 Dec 2002 01:59:39 -0500 Subject: [Expat-discuss] Simple C Expat Wrapper (SCEW) In-Reply-To: <878yz79wp5.fsf@klauz.googy.org> References: <878yz79wp5.fsf@klauz.googy.org> Message-ID: <15853.42971.378860.419478@grendel.zope.com> Aleix Conchillo Flaque writes: > i've created a very simple C expat wrapper. the wrapper works in a DOM > way instead of the handlers like expat. it first uses the expat handlers > to read the xml tree an creates a tree memory structure. it then has > functions to retreive elements and attribute from that tree. This looks cool; thanks for posting about it! > the library is not yet downloadable, i'm pulishing it. it will be > available in a couple of days. but you can still look at an example and > the documentation at the home page. I've added a link in the version of the libexpat.org Web pages in CVS, but there seems to be a problem getting it updated on the server; not sure why. It should appear online in the next day or so. I look forward to hearing more about SCEW! -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake at acm.org Wed Dec 4 07:02:47 2002 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed, 4 Dec 2002 02:02:47 -0500 Subject: [Expat-discuss] Simple C Expat Wrapper (SCEW) In-Reply-To: <15853.42971.378860.419478@grendel.zope.com> References: <878yz79wp5.fsf@klauz.googy.org> <15853.42971.378860.419478@grendel.zope.com> Message-ID: <15853.43159.960072.190289@grendel.zope.com> Fred L. Drake, Jr. writes: > I've added a link in the version of the libexpat.org Web pages in CVS, > but there seems to be a problem getting it updated on the server; not > sure why. It should appear online in the next day or so. Well, I've slammed the file into place instead of using the elaborate mechanism I've been using at SourceForge (CVS ;), so the link is on www.libexpat.org now. Again, thanks for letting us know about SCEW. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From aconchillo at acm.org Tue Dec 3 11:47:28 2002 From: aconchillo at acm.org (Aleix Conchillo Flaque) Date: 03 Dec 2002 12:47:28 +0100 Subject: [Expat-discuss] Simple C Expat Wrapper (SCEW) In-Reply-To: <001f01c29abf$b3bec450$4a00a8c0@gfnt> References: <878yz79wp5.fsf@klauz.googy.org> <001f01c29abf$b3bec450$4a00a8c0@gfnt> Message-ID: <874r9v9ve7.fsf@klauz.googy.org> Georg F=FCchsle writes: > Hallo Aleix. >=20 > For me Your SCEW seems to be very interesting. > I have an application using DOM and now - because DOM is really slow - I > would like to use Expat. > But my question: You build up a tree holding all information about the xml > read before you can start your interpretation. Is your parser in this way > still much faster than DOM? >=20 well, i guess SCEW is a little bit slower than Expat. because it first uses expat to load the xml tree (this step is as fast as Expat in parsing terms and you must count the creation of the structre in memory). after it is loaded you must call SCEW functions to get the element, so we could say it does two steps. but i'm sure is a lot more faster than using xerces or big parsers. i've not created very complicated tree structures, because i wanted to be as fast as possible, so may be it will feed your needs. regards, aleix From aconchillo at acm.org Wed Dec 4 08:48:24 2002 From: aconchillo at acm.org (Aleix Conchillo Flaque) Date: 04 Dec 2002 09:48:24 +0100 Subject: [Expat-discuss] Simple C Expat Wrapper (SCEW) In-Reply-To: <15853.42971.378860.419478@grendel.zope.com> References: <878yz79wp5.fsf@klauz.googy.org> <15853.42971.378860.419478@grendel.zope.com> Message-ID: <87d6oiyxt3.fsf@klauz.googy.org> "Fred L. Drake, Jr." writes: > > I've added a link in the version of the libexpat.org Web pages in CVS, > but there seems to be a problem getting it updated on the server; not > sure why. It should appear online in the next day or so. > yeah! it is already online! thanks for adding the link. > > I look forward to hearing more about SCEW! > yesterday night i did the first tarball and uploaded the source tree to CVS. i will add a link to the savannah project page in the scew home page so it will be easy to access cvs, forums, bug tracking... i guess i will upload scew 0.1.0 tonight. but i'd like to do some more revision. not to the code itself, but the package. best regards, aleix From Marco.Franchini at formula.it Thu Dec 5 16:33:07 2002 From: Marco.Franchini at formula.it (Franchini Marco) Date: Thu, 5 Dec 2002 17:33:07 +0100 Subject: [Expat-discuss] expat on AS/400 Message-ID: <71F486E65C9ED211865300A024AC37CCA67932@VENERE> I'm trying tu use Expat on OS400: I have created a source files H and QCSRC with record length of 240 = bytes in OS/400 file system; I had to change the names longer then 10 characters (and consequently = the source code) and I have copied in file H the source: ASCII =20 ASCIITAB =20 CODEPAGE =20 EXPAT =20 EXPAT_CONF FILEMAP =20 FILEMAPSAV IASCIITAB=20 INTERNAL=20 LATIN1TAB NAMETAB =20 UTF8TAB =20 WINCONFIG XMLFILE =20 XMLMIME =20 XMLROLE =20 XMLTCHAR =20 XMLTOK =20 XMLTOK_IMP XMLURL =20 and in file QCSRC the source: CLIENT =20 CODEPAGE =20 CT =20 READFILEMP XMLFILE =20 XMLMIME =20 XMLPARSE =20 XMLROLE =20 XMLTOK =20 XMLTOK_IMP XMLTOK_NS=20 XMLWF then I have created the module whith CRTCMOD command specifying = SYSIFCOPT=3D*ALL to use Integrated File System CLIENT =20 CODEPAGE =20 READFILEMP XMLFILE =20 XMLMIME =20 XMLPARSE =20 XMLROLE =20 XMLTOK =20 XMLWF and created XMLWF program using command: CRTPGM PGM(LIBEXPAT/XMLWF) MODULE(XMLFILE XMLMIME XMLPARSE XMLROLE = XMLTOK CODEPAGE READFILEMP XMLWF) =20 ENTMOD(XMLWF) DETAIL(*FULL) AUT(*ALL) TGTRLS(V4R4M0) = =20 but I'm not sure thet the application works correctly Has anyone worked with Expat on OS400 ? Thanks. From warren.powell at eds.com Wed Dec 11 12:54:49 2002 From: warren.powell at eds.com (Warren Powell) Date: Tue Dec 10 20:09:56 2002 Subject: [Expat-discuss] Special html char handling Message-ID: Just a quick question, with a simple answer, I'm sure. I have set XML_SetCharacterDataHandler to a quickly hacked function that should just print the element text i.e: void showtext(void *userData, const char *s, int len) { char Buff2[BUFFSIZE]; int cnt; if ( ( Depth > 2) && (Element[0] != '\0') ) { printf("Element %s is ", Element); for (cnt=0; cnt < len ; cnt++) Buff2[cnt]=s[cnt]; Buff2[cnt]='\0'; printf("%s\n", Buff2); } strcpy(Element,"\0"); } But when parsing an XML file, html special chars such as < and & cause the output to be truncated at the spoecial character ampersand. Does XML_Parse do the conversion or am I missing something obvious here? Thanks, Warren Powell From abolgar at obj-sys.com Wed Dec 11 04:11:01 2002 From: abolgar at obj-sys.com (Artyom S. Bolgar) Date: Tue Dec 10 20:13:02 2002 Subject: [Expat-discuss] Projects, that use Expat. References: <200211302131.gAULV1805656@pehoe.civil.ist.utl.pt> Message-ID: <00f301c2a0b2$2c819d70$dededede@kitty> Hello, All! I just thought, maybe it will be good idea to add the links from www.libexpat.org to the projects, which use the Expat. Either commercial and not. Just to demonstrate the popularity of Expat. The first link is www.obj-sys.com :) - an ASN.1 tools, Expat used for decoding XML Encoding Rules (XER). BTW, we also developed the SAX-like C++ interface for Expat. Yours sincerely. Artyom Bolgar. From abolgar at mail.natm.ru Wed Dec 11 04:19:42 2002 From: abolgar at mail.natm.ru (Artyom S. Bolgar) Date: Tue Dec 10 20:19:33 2002 Subject: [Expat-discuss] Projects, that use Expat. Message-ID: <010701c2a0b3$625da690$dededede@kitty> Hello, All! I just thought, maybe it will be good idea to add the links from www.libexpat.org to the projects, which use the Expat. Either commercial and not. Just to demonstrate the popularity of Expat. The first link is www.obj-sys.com :) - an ASN.1 tools, Expat used for decoding XML Encoding Rules (XER). BTW, we also developed the SAX-like C++ interface for Expat. Yours sincerely. Artyom Bolgar. From karl at waclawek.net Tue Dec 10 21:16:26 2002 From: karl at waclawek.net (Karl Waclawek) Date: Tue Dec 10 21:15:11 2002 Subject: [Expat-discuss] Special html char handling References: Message-ID: <000701c2a0bb$4f909880$0207a8c0@karl> > Just a quick question, with a simple answer, I'm sure. > > I have set XML_SetCharacterDataHandler to a quickly hacked function that > should just print the element text i.e: > > void showtext(void *userData, const char *s, int len) > { > > char Buff2[BUFFSIZE]; > int cnt; > > if ( ( Depth > 2) && (Element[0] != '\0') ) { > > printf("Element %s is ", Element); > > for (cnt=0; cnt < len ; cnt++) > Buff2[cnt]=s[cnt]; > Buff2[cnt]='\0'; > > printf("%s\n", Buff2); > } > strcpy(Element,"\0"); > } > > But when parsing an XML file, html special chars such as < and & > cause the output to be truncated at the spoecial character ampersand. Does > XML_Parse do the conversion or am I missing something obvious here? It could be that Expat reports the character data in multiple calls, since the dereferencing of the character entity references interrupts the character stream. Maybe you are only checking the first callback, instead all of them. Karl From swapnel.shrivastava at mentorix.com Mon Dec 30 16:15:22 2002 From: swapnel.shrivastava at mentorix.com (Swapnel) Date: Mon Dec 30 05:46:31 2002 Subject: [Expat-discuss] Problem in extracting elements of an XML file Message-ID: Hi, I've Problem in extracting elements of an XML file. My Sample xml file is given below, IMP XYZ 123 I want to extract Elements in this i.e. IMP,XYZ & 123. Can anybody give me some idea how to extract that or which API's I shoud use. Thanks in advance Swapnel From c.renner at gocomputer.de Tue Dec 31 12:58:24 2002 From: c.renner at gocomputer.de (Christian Renner) Date: Tue Dec 31 08:16:34 2002 Subject: [Expat-discuss] How to deal with simple entities in external DTD Message-ID: Hello everybody, I started using expat a couple of days ago. Since my XML docs use German language, there are letters not included in UTF-8 (such as '?' etc.). To handle that, I declared entities in my external dtd. If I parse one of my xml docs with my C Parser using expat, the external dtd is ignored and my entities as well (as it is described in the expat ref doc). Fine to this point, since the parser works first of all. But when parsing, I'd like the parse not to ignore my entities (I know I could use internal defs but this is not an option, since I have about 20 xml files!). Thus, I set the ExternalEntityHandler und parse the external entity. But now, the parsing stops whenever one of my entities is found. Therefore, the question is, what I have to do to get my external dtd with the entity definitions work in my xml files when parsing. I hope you can help me out. Thanks to you all Christian From fdrake at acm.org Tue Dec 31 09:10:07 2002 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Dec 31 09:10:39 2002 Subject: [Expat-discuss] How to deal with simple entities in external DTD In-Reply-To: References: Message-ID: <15889.42303.940864.927723@grendel.zope.com> Christian Renner writes: > Thus, I set the ExternalEntityHandler und parse the external entity. But > now, the parsing stops whenever one of my entities is found. Therefore, the > question is, what I have to do to get my external dtd with the entity > definitions work in my xml files when parsing. I hope you can help me out. Have you called XML_SetParamEntityParsing() with a second argument of XML_PARAM_ENTITY_PARSING_ALWAYS or XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE? Have you determined that your handler is being called? -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation