on ‎2008 Jan 23 12:18 PM
Hi Gurus,
Please provide me the difference between element and attribute.
It would be great,if I can get some example with exact usage.
Regards,
MohanRaj
Request clarification before answering.
Hi Mohan,
Elements and Attributes
You create complex data types using elements and attributes in the XSD editor:
Node Type
Use
Example Instance
Element
Create structured data types. Elements that have a type cannot contain subelements.
<myElem>
<f1> Value of f1 </f1>
<f2> Value of f2 </f2>
</myElem>
Attribute
Add attributes to elements. Attributes cannot usually have subnodes.
<myElem myAttr="AttributeValue">
Element Value
</myElem>
You can flag an attribute as optional or required in the Occurrence column. These values mean the same for elements with an occurrence of 0..1 or 1. The only difference between elements and attributes is that attributes cannot have subnodes and that the same attribute cannot be used more than once in an element.
Regards,
Phani
Reward points if Helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.