• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

complexType, simpleType, complexContent, simpleContent

 
andy armstrong
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a hard time understanding the concept between all these
and when each should be used. Does anyone have a clear concise
explaination?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simpleType defines an element that doesn't have child elements.
A complexType defines an element that may have child elements.
Similarly, a simpleContent specifies the rules for text-only element content (of a simpleType) and a complexContent specifies the rules for the kinds of child elements (possibly mixed content) that particular complexType can have.
 
Joe Nguyen
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simpletype does not contain any attribute.
As long as attribute is present, it must be a complexType
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And a ComplexType with attributes but no Child Elements only text is

ComplexType with SimpleContent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic