Jump to content

Schema :extension tag


padmagvs

Recommended Posts

I am not clear about the <complexcontent> ,<extension> tagslike if i have <prod id="123">abcd</prod>the schema for this complex element is something like this<element name prod><complexType><simplecontent><extension base=string>.......here extension tag is used to describe the body content abcd is stringbut how ever in complex content when we use this tag i couldn't understandsay example in w3schools<xs:element name="employee" type="fullpersoninfo"/><xs:complexType name="personinfo"> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:sequence></xs:complexType><xs:complexType name="fullpersoninfo"> <xs:complexContent> <xs:extension base="personinfo"> <xs:sequence> <xs:element name="address" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="country" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent></xs:complexType>here what extension mean like can i relate this to java inheritance like fullpersoninfo has address ncity,country and alsopersoninfo like firstname,lastname elements also get here, is it somthing like this <xs:complexType name="fullpersoninfo"> <xs:complexContent> <xs:sequence> <xs:element name="address" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="country" type="xs:string"/> < xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent></xs:complexType>am i right please explain

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...