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]

Reply via email to