<html><div style='background-color:'><DIV class=RTE>
<P>Shouldnt the Element Dispatch be a complex type , containing other complex or simple elements</P>
<P> </P>
<P>Regards</P>
<P> </P>
<P>Mahesh<BR><BR></P></DIV>
<DIV></DIV>>From: "Gregory S. Hill" <ghill@vmtllc.com>
<DIV></DIV>>To: "jdom-interest@jdom.org" <jdom-interest@jdom.org>
<DIV></DIV>>Subject: [jdom-interest] trying to validate xml
<DIV></DIV>>Date: Thu, 13 Jan 2005 14:36:56 -0500
<DIV></DIV>>
<DIV></DIV>>Hey gang.
<DIV></DIV>>
<DIV></DIV>>I'm trying to validate my xml, using a schema I built, based on a
<DIV></DIV>>schema extracted (using XMLSpy) from a SQL Server database. I am
<DIV></DIV>>following the instructions in the FAQ on the jdom.org site. I get
<DIV></DIV>>an error message, and the key passage appears to be this:
<DIV></DIV>>
<DIV></DIV>>".... Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot
<DIV></DIV>>find the declaration of element 'Dispatch'."
<DIV></DIV>>
<DIV></DIV>>/Dispatch/ is the root element of my document. It will look
<DIV></DIV>>something like:
<DIV></DIV>>
<DIV></DIV>><?xml version="1.0" encoding="UTF-8"?>
<DIV></DIV>><Dispatch>
<DIV></DIV>> <DispatchID>685</DispatchID>
<DIV></DIV>> <DispatchEmaisUserID>156</DispatchEmaisUserID>
<DIV></DIV>> <DispatchEntered>12/3/2004 9:40:03 AM</DispatchEntered>
<DIV></DIV>> <DispatchStatusItem>
<DIV></DIV>> <ItemID>2033</ItemID>
<DIV></DIV>> <ClassID>218</ClassID>
<DIV></DIV>> <GroupID>0</GroupID>
<DIV></DIV>> <ItemName>Submitted</ItemName>
<DIV></DIV>> <ItemCode>2</ItemCode>
<DIV></DIV>> </DispatchStatusItem>
<DIV></DIV>>.
<DIV></DIV>>.
<DIV></DIV>>.
<DIV></DIV>>
<DIV></DIV>>The schema looks, in part, like this:
<DIV></DIV>>
<DIV></DIV>><?xml version="1.0" encoding="UTF-8"?>
<DIV></DIV>><!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by
<DIV></DIV>>Gregory S. Hill (Zoetic Consulting) -->
<DIV></DIV>><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
<DIV></DIV>>xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
<DIV></DIV>>elementFormDefault="qualified" attributeFormDefault="unqualified">
<DIV></DIV>> <xs:element name="Dispatch" sql:relation="Dispatch"
<DIV></DIV>>sql:key-fields="lDispatchID" type="Dispatch_Type" />
<DIV></DIV>> <xs:complexType name="Dispatch_Type">
<DIV></DIV>> <xs:sequence>
<DIV></DIV>> <xs:element name="lDispatchID" sql:relation="Dispatch"
<DIV></DIV>>sql:field="lDispatchID" sql:datatype="int">
<DIV></DIV>> <xs:simpleType>
<DIV></DIV>> <xs:restriction base="xs:integer">
<DIV></DIV>> <xs:maxInclusive value="2147483647" />
<DIV></DIV>> <xs:minInclusive value="-2147483648" />
<DIV></DIV>> </xs:restriction>
<DIV></DIV>> </xs:simpleType>
<DIV></DIV>> </xs:element>
<DIV></DIV>> <xs:element name="lDispatchEmaisUserID" nillable="true"
<DIV></DIV>>sql:relation="Dispatch" sql:field="lDispatchEmaisUserID"
<DIV></DIV>>sql:datatype="int">
<DIV></DIV>> <xs:simpleType>
<DIV></DIV>> <xs:restriction base="xs:integer">
<DIV></DIV>> <xs:maxInclusive value="2147483647" />
<DIV></DIV>> <xs:minInclusive value="-2147483648" />
<DIV></DIV>> </xs:restriction>
<DIV></DIV>> </xs:simpleType>
<DIV></DIV>> </xs:element>
<DIV></DIV>>.
<DIV></DIV>>.
<DIV></DIV>>.
<DIV></DIV>>
<DIV></DIV>>The documents for the above snippets are quite long, so I won't
<DIV></DIV>>burden you with those. Can you see what I'm doing wrong? This is
<DIV></DIV>>my first real schema, and am completely willing to own the fact that
<DIV></DIV>>I may have my head up my ass re: doing it right! Any tips would be
<DIV></DIV>>greatly appreciated.
<DIV></DIV>>
<DIV></DIV>>-greg
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>To control your jdom-interest membership:
<DIV></DIV>>http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
<DIV></DIV></div></html>