aspose file tools*
The moose likes Product and Other Certifications and the fly likes Question about Extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Question about Extension" Watch "Question about Extension" New topic
Author

Question about Extension

Himal Chuli
Ranch Hand

Joined: Aug 06, 2002
Posts: 118
hi guys,
i've the following;
<xs:element name="shoesize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
what's implication of using extension in the above? could someone please explain it?
appreciate.
himal


Himal
Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
It means that we are extending a simpleType to have an attribute. If you extend a complexType, you should have a complexContent rather.
Himal Chuli
Ranch Hand

Joined: Aug 06, 2002
Posts: 118
we are extending an integer and again defining it as being string. it's kinda confusing to me..so what type of value the attribute's gonna hold now?
could you please explain it?
himal
Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
Integer is the element(shoesize) content type and string is the attribute(country) content type.
Eg: <shoesize country="USA">8</shoesize>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question about Extension