File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "why schema have two grammer????" Watch "why schema have two grammer????" New topic

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 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: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:attribute name="country" type="xsd:NMTOKEN"

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

Joined: Jul 13, 2001
Posts: 3150
The first one is not the XML schema based on

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
I agree. Here's the link:
subject: why schema have two grammer????
It's not a secret anymore!