This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes why schema have two grammer???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "why schema have two grammer????" Watch "why schema have two grammer????" New topic
Author

why schema have two grammer????

Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
I find that the schema document have two different grammer.
One is like this:
<ElementType name="AD" content="eltOnly" model="closed">
<element type="StAd" minOccurs="0"/>
<element type="OtDe" minOccurs="0"/>
<element type="City" minOccurs="0"/>
<element type="StPr" minOccurs="0"/>
<element type="ZipPC" minOccurs="0"/>
<element type="Country" minOccurs="0"/>
<element type="AdTy" minOccurs="0"/>
<element type="OtGD" minOccurs="0"/>
</ElementType>
<ElementType name="StAd" content="textOnly" model="closed"/>
<ElementType name="OtDe" content="textOnly" model="closed"/>
<ElementType name="City" content="textOnly" model="closed"/>
<ElementType name="StPr" content="textOnly" model="closed"/>
<ElementType name="ZipPC" content="textOnly" model="closed"/>
<ElementType name="Country" content="textOnly" model="closed"/>
<ElementType name="AdTy" content="textOnly" model="closed"/>
<ElementType name="OtGD" content="textOnly" model="closed"/>

and two is:
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd ecimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN"
fixed="US"/>
</xsd:complexType>

Why ???
please tell me...
thank
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
The first one is not the XML schema based on http://www.w3c.org/XML/Schema


Spritle Software Blogs
Lance Duncan
Ranch Hand

Joined: Jul 28, 2003
Posts: 39
the first is old one, but has some advantange over the newer one
 
Consider Paul's rocket mass heater.
 
subject: why schema have two grammer????
 
Similar Threads
schema validation
XML Schema - doubt..
AXis 2 and Array in doc literal wsdl
how to define parameter for complex type in web service?
question - "all" group