cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Difference between element and attributes while creating data types

Former Member
0 Likes
6,349

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

View Entire Topic
Former Member
0 Likes

Hi,

Element is everything from (including) the element's start tag to (including) the element's end tag.

An element can contain other elements, simple text or a mixture of both. Elements can also have attributes.

Attributes often provide information that is not a part of the data. In the example below, the file type is irrelevant to the data, but important to the software that wants to manipulate the element.

In case you use the JDBC Adapter, for example. The muster XML-SQL from help.sap.com use attribute action to describe what kind of action should be performed, but action does not belongs to Payload, for example the content you want to insert into one table, does NOT contain action.

<root>

<StatementName1>

<dbTableName action=”UPDATE” | “UPDATE_INSERT”>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

regards,

Hai