[xml] program interaction with XML config

Hello -

I'm writing my first libxml2 program and first serious DTD design of
any kind.  The program is a tablebase generator for analyzing chess
endgames and the XML is used both as a configuration file to control
the operation of the program and as a header on the generated
tablebases.  Things like piece colors and types, any restrictions on
their movements, how to handle captures and queening, the exact layout
of the tablebase format, etc, are all specified in XML.

My problem relates to the DTD.  Right now, I'm just using a SYSTEM
descriptor with the DTD in the cwd.  I've thought of using a PUBLIC
descriptor; I've thought of using catalogs, but's here my issue.

I really think that I want the DTD to be tied to the version of the
program.  This is because I rely heavily on the DTD to validate my XML
input.  I don't, for example, check for any unknown elements in the
config file - I just assume that if the thing passed validation, then
it can't have any unknown elements in it.  Makes the code a lot

So I really don't want the program to go out over the network and get
the latest and greatest version of the DTD, right?  I want it to
validate against the version that the program is compiled with...
I think.

So here's what it comes down to (I've provided all this other stuff as
background so you can understand where I'm coming from):

Can I hardwire the DTD into the program?  I don't see anything in the
API that lets me load a DTD from a char[] buffer - did I miss this?

Or can anyone suggest some other way to handle this that I'm missing?

Thank you.


                                        Brent Baccala
                                        cosine freesoft org

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