Re: [xml] Determining the meaning of each xmlError

On Mon, Mar 29, 2004 at 08:41:13PM -0600, Philip Thompson wrote:
Hello.  Some friends and I are writing a Mac OS X-native XML editor.  
We're using libxml2 to check well-formedness and validate against a 
DTD.  We eventually want to localize the app, and as such we need to 
localize the error messages.

What I'm doing now is going through the code and trying to determine 
what each field in the xmlError struct (str1, str2, int1, int2, etc) 
means for each type of XML error and error domain.  Our plan was to 
take this information and then formulate our own error messages.  

  Right, that's the right approach.

Unfortunately, this is taking a bit of time, and on top of that, I've 
found that certain error codes are used in very different ways, with 
different meanings for the various xmlError fields.

  The error code is really what indicates the type of error found,
everything else are extra metadata.

I was wondering if there is a better way to go about this.  In 
particular, is there some documentation available that describes the 
various XML errors and the meaning of each field in that error's 
corresponding xmlError struct? 

  Hum, no. The xmlError struct has been added relatively recently
and tried to handle a variety of situations and errors within the
library, there is no description for each error.

If not, would any of you mind 
suggesting a better way to do this?  I've looked in the archives, but 
was unable to find anything.

  I'm afraid you're doing what's adequate, and that it may not be
simple to cover all cases, but it's also due to the very large amount
of different errors. The domain field is really a key indicator of
where the error comes from, and possibly how it should be handled.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]