Jump to content

Schema :extension tag

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...