cancel
Showing results for 
Search instead for 
Did you mean: 

differience b/w element and attribute...

Former Member
0 Kudos

Hi Experts,

i have a basic doubt,

while creating the datatypes we have an option of creating the fields with an element or attribute,

when should i use element type for the field and when shuld i use attribute type for the fields which we define, so when i right click their we can able to insert either element or attribute, confusing which one to insert..

finally just define what is an element and attribute..

answers will be appreciated..

regards,

reddy

Accepted Solutions (1)

Accepted Solutions (1)

former_member238007
Contributor
0 Kudos

Hi...

Actually before w.r.t the usage of element and attribute u should aware what is an element and what is an attribute..

Element takes the occurence but where as the attribute takes the value as optional or required So, an element is an entity, and attribute is a property of an element..

Take an example as defined above as with car is an element and its color is an attribure

Try to create the elements and attributes, and try with differient posibilities in mapping and test the scenario u will be understanding what en element and attribute is..

regards,

Kishore

Answers (6)

Answers (6)

hemant_chahal
Contributor
0 Kudos

Attributes are to recognise or validate the XML field in runtime as you can have two fields with same name but different attribute in XML source data. now in XI you can validate the actual field to be taken.

Former Member
0 Kudos

Hi,

Element : Elements that have a type cannot contain the sub fields(elements).

Attribute : Add attributes to elements. Attributes cannot usually have subnodes.

Check this link for more info

http://help.sap.com/saphelp_nw04s/helpdata/en/3b/d2a3f7a166514abb8cf5635b71974f/frameset.htm

Former Member
0 Kudos
Former Member
0 Kudos

hi

<Parts uniqueId="10000">part1</Parts>

here in the above XML string Parts is element and uniqueId is attribute, if u find any XML data like this u have to define datatype with attribute and element

Thanks

Madhav

Note:points if useful

Former Member
0 Kudos

Hi,

Check this

Regards

Seshagiri

Former Member
0 Kudos

Refer the below link

http://help.sap.com/saphelp_nw04s/helpdata/en/3b/d2a3f7a166514abb8cf5635b71974f/frameset.htm

Atributes are like properties of elements.

For eg if we describe a car

<car color = "red" make = "xxx">

Alto

</car>

here car is an element and color and make are attributes of car.