[Expat-discuss] XML/expat question/problem?

Keith Jackson kjackson at crimebucket.com
Fri Aug 27 08:17:46 CEST 2004


Alright, I figured it out. Sorry for bothering everyone. :) Apparently,
XML_GetBuffer() has to be called before every call to XML_ParseBuffer().
I was getting a buffer of 1k and then just re-using it. My XML doc just
happened to go over 1k, and that's when the problems started. :P

Thanks again for a great library.

Keith Jackson

-----Original Message-----
From: expat-discuss-bounces at libexpat.org
[mailto:expat-discuss-bounces at libexpat.org] On Behalf Of Keith Jackson
Sent: Thursday, August 26, 2004 11:00 PM
To: expat-discuss at libexpat.org
Subject: RE: [Expat-discuss] XML/expat question/problem?


Thanks for the reply. I added that line to my document as well, but
expat is still complaining as before. I will try to learn more abou
schemas and what not, though, I'm beginning to think it may be a problem
with expat? Feel free to beat me with a stick.

Keith Jackson


-----Original Message-----
From: expat-discuss-bounces at libexpat.org
[mailto:expat-discuss-bounces at libexpat.org] On Behalf Of
John.Hockaday at ga.gov.au
Sent: Thursday, August 26, 2004 10:38 PM
To: expat-discuss at libexpat.org
Subject: RE: [Expat-discuss] XML/expat question/problem?


Hi Keith,

I'm not 100% sure of expat but I do know a little about XML and your
document
is not an XML document instance.  Officially the very first line of an
XML
document instance *must* be:

<?xml version="1.0" ?>

This tells a parser that it is an XML document.  

Once you have done this then you can only check your XML document
instance
for 'well formed ness".  That is that all opened tags are closed or
empty and
that nesting occurs properly.  I have added the above line to your
document
and it is "well formed".

If you want to validate it against a structure you must enter a
reference to
a "DOCTYPE" or an "XSD".  The former is a reference to a Document Type
Definition (DTD) that defines the structure that your XML document
instances
must comply to when validated.  The XSD is an eXtensible Schema
Definition.
There are many of these. Eg. W3C XML Schema, RELAXNG.  These not only
define
the structure that the XML document instances must follow (like the DTD)
but
also some format for the content of the XML elements.  Eg. Dates,
integers,
strings.

Someone else will have to answers the expat errors.

I hope that this helps.


John

> -----Original Message-----
> From: Keith Jackson [mailto:kjackson at crimebucket.com] 
> Sent: Friday, 27 August 2004 3:09 PM
> To: expat-discuss at libexpat.org
> Subject: [Expat-discuss] XML/expat question/problem?
> 
> 
> Hello everyone. First, let me say that if this is a problem because of
> my limited knowledge of XML, please feel free to flame me.
>  
> That being said... I have an XML file that is not parsing. Perhaps one
> of you XML savvy folks could take half a second to see what is going
> on.. Included is the file. I've stepped thru the parsing, and in the
> last 'Control' section (there are three), expat returns
> XML_ERROR_INVALID_TOKEN. The last handler called was the EndNode
> handler, with the last 'From' node in the XML document. We 
> never hit the
> EndNode handler for the last 'Animation'.
>  
> I find it hard to believe there would be a bug in expat, so 
> I'm assuming
> I'm doing something stupid I shouldn't be doing in XML. Anyway, thanks
> guys. Expat is great. It's nice to not have to use all the crazy
> infrastructure and stuff that comes along with SAX and DOM.
>  
> Keith Jackson
>  
> 
_______________________________________________
Expat-discuss mailing list
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss

_______________________________________________
Expat-discuss mailing list
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss



More information about the Expat-discuss mailing list