> 
> Hello John,
> 
> To validate my project-schema.xml, I see that I used something similar:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE app-data SYSTEM "database.dtd">
>
> referring to a local database.dtd, the java.apache.org one was out of
> date at the time.  Should changing the root element from database to
> app-data have any effect? 

I assume it would help, but I was testing similar code within Intake and
did have the root element set correctly.  Basically what happened when I
added the xml declaration and doctype was that xerces finally parsed my
dtd.  I know it did this because I had errors in the DTD that led to
exceptions.  Once I had the dtd correct, I get no further
exceptions/errors from xerces, regardless of whether the xml file was
valid.



 I was able to create non-validating
> conditions, a few from the dtd being out of synch with torque reality,
> most from my own syntax errors.  I used jdom, and just caught any
> exceptions thrown from code like this:
> 
> SAXBuilder builder = new SAXBuilder(true);
> builder.build("project-schema.xml");


I would like to get it figured out directly with xerces.  Torque's
XmlToAppData class contains the line I have commented out below.  I
added the the second feature.  My understanding is as follows: the first
feature sets validation to be optional depending on whether xerces was
able to find the dtd.  The second feature tells xerces to validate.  So
with the first line commented out xerces would throw an exception if it
could not find the dtd.  The first line without the second would not
tell xerces to validate.  But obviously my interpretation is not
completely correct, as I am not getting validation under any
combination.

            //parser.setFeature(
            //    "http://apache.org/xml/features/validation/dynamic",
true);
            parser.setFeature("http://xml.org/sax/features/validation",
true);


> 
> BTW, the lines in the id-table-schema.xml patch are cut verbatim from
> turbine-schema.xml.  I assumed they would have worked there as well but
> did not try first, sorry. :(
>

I assume the fact that the root element is wrong has not been caught
because no validation is occuring.  Torque does not really care about
the root tag, it is just there to make the xml correct.

John McNally


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to