From oms101@freeuk.com Fri Jun 1 09:17:07 2001 From: oms101@freeuk.com (oms101@freeuk.com) Date: Fri, 01 Jun 2001 09:17:07 +0100 (BST) Subject: [Expat-discuss] DTD handling in Expact In-Reply-To: <154jYA-0002MN-00@gate.westel900.hu> Message-ID: On 29-May-01 Ferenc Gémesi wrote: > Dear Gurus, > How can I catch the error in my 'XML' file, if it is not consistent whit my > 'DTD' file? > Thank You > gferi I dont beleive expat does this at all, but I am no expert or guru just a blind man leading another Owen > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@lists.sourceforge.net > http://lists.sourceforge.net/lists/listinfo/expat-discuss Date: 01-Jun-01 Time: 09:16:04 From fdrake@acm.org Fri Jun 1 13:42:45 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 1 Jun 2001 08:42:45 -0400 (EDT) Subject: [Expat-discuss] DTD handling in Expact In-Reply-To: References: <154jYA-0002MN-00@gate.westel900.hu> Message-ID: <15127.36293.304652.128268@cj42289-a.reston1.va.home.com> oms101@freeuk.com writes: > I dont beleive expat does this at all, but I am no expert or guru > just a blind man leading another Expat is not a validating parser and does not perform validation. -Fred -- Fred L. Drake, Jr. PythonLabs at Digital Creations From djm@maccormack.net Tue Jun 5 15:30:17 2001 From: djm@maccormack.net (David MacCormack) Date: Tue, 5 Jun 2001 10:30:17 -0400 (EDT) Subject: [Expat-discuss] predefined entites patch... Message-ID: Hi there. I sent this via the patch submission tool a few days ago, although I thought I'd send it to the list as well. Its something that I've found useful, and thought that others may as well. The patch can be found here at http://sourceforge.net/tracker/?group_id=10127&atid=310127 Dave -- ---------------- David MacCormack djm@maccormack.net ------------------------------------------------ Co-workers and myself have found it useful to be able to disable the expansion of default entities under certain circumstances. For example, in a pipeline such as: app1 | app2 | app3 you only want app3 to actually expand default entities, otherwise you'll get wellformedness (is that a word ?:) errors if you have a character handler installed. A buddy of mine actually hacked the xmltok_impl code and recompiled (which works quite well), but I decided to take a stab at providing a function/runtime means of changing this behavior. The attached patch compiles, runs, and it produces the expected results against my test cases. changes include: * new func decl in expat.h (or expat.h.in I suppose) * a few mods to xmlparse.c Dave From aliciaps@qwest.net Tue Jun 12 21:43:15 2001 From: aliciaps@qwest.net (aliciaps@qwest.net) Date: Tue, 12 Jun 2001 20:43:15 Subject: [Expat-discuss] Got INK? Message-ID: GOT INK? Free Bonus Offer for your Injet Printer *ATTENTION ALL COMPUTER USERS* Tired of paying $20, $30 $40 or even $50 for injet cartridges? Tired of your printer running out of ink AGAIN? Tired of running from store to store looking for the right cartridge? Tired of having to wait until morning to get your printer working? Just Tired of being Tired? IT'S NOT YOUR FAULT THERE IS A SOLUTION!!!!! Throwing away the cartridge when you run out of ink is like throwing away your car when you run out of gas! Don't throw cash in the trash!!! *REFILL YOUR INJET CARTRIDGES* It dosent matter what type of inkjet printer you have, our refill kit works on any printer, any brand, any COLOR. With our refill kit you get all the ink & tools you need to refill your inkjet cartridge up to 10 times. Our refill kit is fast, easy & simple to use. Our INKJET REFILL KIT includes: 1 Bottle Of Black Ink 1 Bottle Of Cyan Ink 1 Bottle Of Yellow Ink 1 Bottle of Magenta Ink 1 Accessory Kit 1 Instructional CD-ROM 1 Instructional Manual 1 Access To Our Website For Online Help 1 Access To Our Live 24 Hour Tech Support All this for $29.95 + shipping and handling. Black only kits are available for even less. But wait, there's more! Be one of the next 500 to order and we'll include another bottle of black ink (total of two) absoluteluy FREE Call 1-866-947-0802 and mention the "Summer Ink" Special or reply to this email for more information. Alicia Wiles FillJet eCommerce Group This message is in full compliance with U.S. Federal requirements for commercial email under bill S.1618 Title lll, Section 301, Paragraph (a)(2)(C) passed by the 105th U.S. Congress and cannot be considered SPAM since it includes a remove mechanism. Further transmissions by the sender may be stopped at no cost to you by replying to the email address and place "REMOVE" in the subject line. From elango@immunbio.mpg.de Fri Jun 15 14:48:05 2001 From: elango@immunbio.mpg.de (Elango, Palchamy) Date: Fri, 15 Jun 2001 15:48:05 +0200 Subject: [Expat-discuss] Compile on Tru64 Unix ver 5.1 (OSF/1) References: Message-ID: <3B2A1215.D7BD6470@immunbio.mpg.de> ---------------------- multipart/alternative attachment Could any one let me know how to compile Expat on Compaq Unix ? Which version of the Expat should be compiled on this mache? I tried all versions of this tool, no success! make and make install don't work properly. Thanks in advance. Elango ---------------------- multipart/alternative attachment An HTML attachment was scrubbed... URL: http://mail.libexpat.org/pipermail-21/expat-discuss/attachments/20010615/fc95054c/attachment.html ---------------------- multipart/alternative attachment-- From jf.vdleij@wolmail.nl Wed Jun 20 13:10:33 2001 From: jf.vdleij@wolmail.nl (Johan en Dera van der Leij) Date: Wed, 20 Jun 2001 14:10:33 +0200 Subject: [Expat-discuss] expat version for Compaq Openvms Message-ID: <01c0f982$01eabe80$b1d5f1c3@default> Dit is een meerdelig bericht in MIME-indeling. ---------------------- multipart/alternative attachment Hello, Is there an expat version for Compaq OpenVMS system Regards, Johan van der Leij ---------------------- multipart/alternative attachment An HTML attachment was scrubbed... URL: http://mail.libexpat.org/pipermail-21/expat-discuss/attachments/20010620/1fba4e18/attachment.html ---------------------- multipart/alternative attachment-- From michael.isard@compaq.com Wed Jun 20 18:57:51 2001 From: michael.isard@compaq.com (Michael Isard) Date: Wed, 20 Jun 2001 10:57:51 -0700 (PDT) Subject: [Expat-discuss] interface to XML_GetInputContext Message-ID: <15152.58399.820581.954228@diamond.pa.dec.com> I have a request for strengthening the interface to XML_GetInputContext. The current comment in expat.h reads: /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise returns a null pointer. Also returns a null pointer if a parse isn't active. NOTE: The character pointer returned should not be used outside the handler that makes the call. */ First I would like it to guarantee that (size-offset) >= XML_GetCurrentByteCount() i.e. that the current event is contained within the buffer. Without this guarantee the client has to write a bunch of code to save partial data. Second I would like it to guarantee that the last character in the returned buffer corresponds to the last character passed to the most recent call of XML_Parse or XML_ParseBuffer (not that it has the same memory location necessarily, just that all the data which has been passed to the parser since the start of the current event is visible in the buffer). As far as I can tell by reading the source both are true in the current implementation but I would be very grateful to be corrected if I have misread it. I do have a reason for the second request... I am writing a routine which streams an XML document rewriting some characters near the beginning but leaving the bulk untouched. Therefore I would like to be able to detect in a callback that I have finished all the rewriting I am going to do, and simply copy the rest of the file rather than parsing it. I am currently implementing this strategy as follows: ... void final_callback(void *ud) { mydata d = (mydata) ud; int offset, size; char *buf; buf = XML_GetInputContext(d->parser, &offset, &size); d->finished = TRUE; d->write(buf + offset, size - offset); } ... /* main parse loop */ while (!(d->finished)) { buf = XML_GetBuffer(d->parser, bufsize); n = d->read(buf, bufsize); XML_ParseBuffer(d->parser, n, 0); } while (n > 0) { n = d->read(static_buf, bufsize); d->write(static_buf, n); } ... but this will only work if the second condition above is satisfied. Do you have any advice for a better way to do this if you don't want to change the interface? Thanks, Michael Isard. From oms101@freeuk.com Wed Jun 20 23:39:18 2001 From: oms101@freeuk.com (oms101@freeuk.com) Date: Wed, 20 Jun 2001 23:39:18 +0100 (BST) Subject: [Expat-discuss] interface to XML_GetInputContext In-Reply-To: <15152.58399.820581.954228@diamond.pa.dec.com> Message-ID: > > but this will only work if the second condition above is satisfied. Do > you have any advice for a better way to do this if you don't want to > change the interface? > > Thanks, > Michael Isard. Cant help on answering it just want to say that I have reached the same situation but instead of doing what you are doing I just let the passer pass the rest of the document to be safe. It would be better if there was a standard way to do what you intend by your code. (PS newbie here) Owen Synge From jochen@cs.ucr.edu Thu Jun 21 21:33:54 2001 From: jochen@cs.ucr.edu (Jochen Hartmann) Date: Thu, 21 Jun 2001 13:33:54 -0700 Subject: [Expat-discuss] PUBLIC ID Message-ID: <009c01c0fa91$7de18ef0$22c7178a@cs.ucr.edu> Hey, I don't know how to handle PUBLIC Ids in the DOCTYPE: Results in an EXPAT error message: syntax error at line ... If I change 'PUBLIC' to 'SYSTEM' it works, but than an other program working with this XML-File crashed. Any ideas? Thank you. Best regards Jochen From ebohlman@earthlink.net Thu Jun 21 23:49:08 2001 From: ebohlman@earthlink.net (Eric Bohlman) Date: Thu, 21 Jun 2001 17:49:08 -0500 Subject: [Expat-discuss] PUBLIC ID Message-ID: <200106212224.PAA21711@falcon.mail.pas.earthlink.net> 6/21/01 3:33:54 PM, "Jochen Hartmann" wrote: >I don't know how to handle PUBLIC Ids in the DOCTYPE: > >DTD:V0.16.6:MYDTD.DTD//EN"> > >Results in an EXPAT error message: syntax error at line ... > >If I change 'PUBLIC' to 'SYSTEM' it works, but than an other program >working with this XML-File crashed. That's not a legal XML document type declaration (though it would be legal in SGML). In XML, you need either PUBLIC followed by a public ID followed by a system ID (URI), or SYSTEM followed by a system ID. You can't have just a public ID without a system ID. From phule888@hotmail.com Fri Jun 22 12:45:26 2001 From: phule888@hotmail.com (Kevin quackquack) Date: Fri, 22 Jun 2001 13:45:26 +0200 Subject: [Expat-discuss] [HELP] Expat handlers not being triggered Message-ID: Hi, I've just recently switched to trying out expat in a project here. Using the expat library as a background process in a solaris environment. I have tested the individual examples, and they appear to work ok. In my background process. I have the following basic testing handlers declared void default_hndl(void *data, const char *s, int len) { char sz_buffer[MAXLINELENGTH]; char sz_txt[MAXLINELENGTH]; strncpy(sz_txt, s, len); sprintf(sz_buffer, "Default Handler called - %s", sz_txt); PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DBUG, sz_buffer); } void start_hndl(void *data, const char *el, const char **attr) { char sz_buffer[MAXLINELENGTH]; sprintf(sz_buffer,"Start Handler called - %s", el); PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DEBUG, sz_buffer); } void end_hndl(void *data, const char *el) { char sz_buffer[MAXLINELENGTH]; sprintf(sz_buffer,"End Handler called - %s", el); PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DEBUG, sz_buffer); } void char_hndl(void *data, const char *txt, int txtlen) { char sz_buffer[MAXLINELENGTH]; char sz_txt[MAXLINELENGTH]; strncpy(sz_txt, txt, txtlen); sprintf(sz_buffer,"Char Handler called - %s", sz_txt); PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DEBUG, sz_buffer); } Within a certain function for parsing. I have ... XML_Parser parser = XML_ParserCreate(NULL); XML_fields_t *lpst_xml_fields; if (!PIN_ERR_IS_ERR(ebufp)) { XML_UseParserAsHandlerArg(parser); XML_SetUserData(parser, lpst_xml_fields); XML_SetDefaultHandler(parser, default_hndl); XML_SetElementHandler(parser, start_hndl, end_hndl); XML_SetCharacterDataHandler(parser, char_hndl); } if (!PIN_ERR_IS_ERR(ebufp)) { if (! (XML_Parse(parser, sz_xml_doc, sizeof(sz_xml_doc), 1))) { /* Log the error */ } } When I run it through, it appears to go through the Parser. The XML document is formatted appropriately, but it doesn't appear to trigger off any of the handlers. Additional information is that multiple copy of this code is running as a background process ready to accept information (xml document) for it to send off (http/xml), returned, and the return document is what I am attempting to parse here. It's just a little one with about 5 simple tags which I'm interested in. Additional weird behaviour. If I set XML_DefaultCurrent(parser) as well, after the handlers had been set, it seems to crash during runtime, during the function reportDefault (probably since this daemon process shouldn't/cannot write to stdout/stderr or something). I'm looking into this now. For those that are interested, This code fragment is part of a custom Data Manager for customisation a product called Portal Infranet. any suggestions/help/hints? Cheers, --Kevin phule888@hotmail.com +31 6 2040 9315 _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From noxley@rsasecurity.com Mon Jun 25 16:08:39 2001 From: noxley@rsasecurity.com (Oxley, Nicholas) Date: Mon, 25 Jun 2001 16:08:39 +0100 Subject: [Expat-discuss] BOM Header causes an access violation exception Message-ID: <418A63CAEBF2D4118A1A00508BB1A0B8568C21@exuk01> Hi, I'm using expat to parse UTF-8 data. I've been using the Windows 2000 Notepad to edit and save in UTF-8 format so that I can test using unicode characters. I've found that when I don't strip the byte order mark from the UTF-8 file that notepad generates, expat throws an exception. In the initScan() function (xmltok.c ln. 1488) it correctly identifies that the first three characters of the data buffer are in fact, a byte order mark, and returns XML_TOK_BOM. In the doProlog() function, the XmlTokenRole() function returns XML_ROLE_NONE (which does nothing in this context..). The data buffer is set ( s = next; ln. 3252) (next is null), and then XmlPrologTok is called with the parameters: XmlPrologTok(utf8_encoding, s (NULL ptr), end (reference to some heap memory), &next (address of s)); Then, on ln. 983, there is a switch(BYTE_TYPE(enc, ptr)). And Boom, the null pointer which it is mapped to is dereferenced. #define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) #define SB_BYTE_TYPE(enc, p) \ (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) If anyone could shed any light on this problem, that'd be great. Kindest Regards, Nicholas. From fdrake@acm.org Mon Jun 25 16:37:22 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 25 Jun 2001 11:37:22 -0400 (EDT) Subject: [Expat-discuss] BOM Header causes an access violation exception In-Reply-To: <418A63CAEBF2D4118A1A00508BB1A0B8568C21@exuk01> References: <418A63CAEBF2D4118A1A00508BB1A0B8568C21@exuk01> Message-ID: <15159.23218.380664.928568@cj42289-a.reston1.va.home.com> Oxley, Nicholas writes: > I'm using expat to parse UTF-8 data. I've been using the Windows 2000 > Notepad to edit and save in UTF-8 format so that I can test using unicode > characters. I've found that when I don't strip the byte order mark from the > UTF-8 file that notepad generates, expat throws an exception. This has been fixed in the CVS version of Expat -- feel free to use that version instead of 1.95.1. -Fred -- Fred L. Drake, Jr. PythonLabs at Digital Creations