I did get this to work. I realized that I had downloaded the xerces stuff from IBM's site, and it apparently uses a slighly older version of the core xerces stuff. I went to the apache site and got 1.3.1, and magically it all started to work.
Thanks for your help!! One question I have is how can I validate the schema itself, before I apply an XML file against it? Can I actually push the XSD file itself through the parser to see if it's correct (catch misspellings, etc.)? -=david=- -----Original Message----- From: NeSmith, David [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2001 1:20 PM To: '[EMAIL PROTECTED]' Subject: RE: Newbie needs a little help Seems to be validating fine for me. I'll attach the main code that I use. - Windows 2000 Pro - Kawa Pro 5.0 - JDK 1.3 - Xerces 3.1.1 (from 1/16/01) -----Original Message----- From: Witherspoon, David [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2001 12:19 PM To: '[EMAIL PROTECTED]' Subject: RE: Newbie needs a little help Thanks for the help, but this didn't actually change anything. I still get the same errors (element type "TaskMaster" must be declared, and same for "LogDirectory" and "Address"). Maybe some info about my environment would help: - Windows NT 4.0 - JBuilder 3.5 - JDK 1.2.2 - Xerces 3.1.1 (from 1/15/01) In the code, I create a DOMParser and an error handler. On the parser, I then set several features, and the error handler. parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true) ; parser.setFeature("http://xml.org/sax/features/validation", true) ; parser.setFeature("http://xml.org/sax/features/namespaces", true) ; parser.setFeature("http://apache.org/xml/features/validation/schema", true) ; parser.setErrorHandler(errorHandler); I commented out all of these features except for validation and got the same result. Any other possibilities? -=david=- -----Original Message----- From: NeSmith, David [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2001 12:00 PM To: '[EMAIL PROTECTED]' Subject: RE: Newbie needs a little help Hello there, These changes seem to make it validate: ++SCHEMA++ <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" elementFormDefault="qualified"> <xsd:element name="TaskMaster"> <xsd:complexType> <xsd:sequence> <xsd:element name="LogDirectory" type="xsd:string" /> <xsd:element name="Address" type="addrType" /> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- Email address type --> <xsd:simpleType name="addrType"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[EMAIL PROTECTED],3}" /> </xsd:restriction> </xsd:simpleType> </xsd:schema> ++XML++ <?xml version="1.0" encoding="UTF-8"?> <TaskMaster xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TMPpersonal.xsd"> <LogDirectory>D:\DataJanitor\Logs</LogDirectory> <Address>[EMAIL PROTECTED]</Address> </TaskMaster> -----Original Message----- From: Witherspoon, David [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2001 11:29 AM To: '[EMAIL PROTECTED]' Subject: Newbie needs a little help Just getting started with schemas, and BAM...right into a wall. I have a very simple xml/xsd sample I'm trying to get going, but the parser keeps giving me an error I just cannot resolve. TMPpersonal.xml: <?xml version="1.0" encoding="UTF-8"?> <TaskMaster xmlns:xsi="http://www.w3.org/2000/4/XMLSchema-instance" xsi:noNamespaceSchemaLocation='TMPpersonal.xsd'> <LogDirectory>D:\DataJanitor\Logs</LogDirectory> <Address>[EMAIL PROTECTED]</Address> </TaskMaster> TMPpersonal.xsd: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2000/4/XMLSchema"> <xsd:element name="TaskMaster"> <xsd:complexType> <xsd:element name="LogDirectory" type="xsd:string" /> <xsd:element name="Address" type="addrType /> </xsd:complexType> </xsd:element> <!-- Email address type --> <xsd:simpleType name="addrType"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[EMAIL PROTECTED],3}" /> </xsd:restriction> </xsd:simpleType> </xsd:schema> I get this error: Element type "TaskMaster" must be declared. Same error message for LogDirectory and Address. What am I missing? Thanks in advance!! -=david=- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
