Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diff between elemment type and ref attribute

 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is diff between element type and ref attribute in xml schema. Please provide example to explain.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The ref attribute:
There are several constraints related to the ref attribute:
- It must be a qualified name referring to a global element type.
- It cannot be used together with the name attribute.
- Only the minOccurs and maxOccurs attributes may be used in an element in which a ref attribute occurs.

The type attribute in an element refers to a global simple type or complex type.
Best wishes!
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Ivan .
I just want to confirm my understanding derived from your reply.
ref and tyep attribute both serves the same purpose but due to the limitations mentioned by you it's preferable to use type attribute. Is is possible for you to give some example where we can use only one of them? Hope I am not troubling you much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic