Search code examples
xmlsoapterminologydefinition

What is the correct terminology of XML's elements?


I am working on a SOAP app, and since it basically uses XML as its data container, I became curious as to what the correct terms for the XML elements are.

For example we have header, body, envelope, but what are the SOAP actions called?

I am specifically wondering what the <something_something> field is called?

And inside a SOAP action one can also find keys and their values such as for example <thisIsAKey>andThisIsItsValue</thisIsAKey>

What is <thisIsAKey></thisIsAKey> called and what is andThisIsItsValue value called?

Are they called just keys and values or what?

I tried to google for XML Protocol.


Solution

  • Look to the W3C XML Recommendation for answers regarding proper terminology for XML elements and attributes:

    [Definition: Each XML document contains one or more elements, the boundaries of which are either delimited by start-tags and end-tags, or, for empty elements, by an empty-element tag. Each element has a type, identified by name, sometimes called its "generic identifier" (GI), and may have a set of attribute specifications.] Each attribute specification has a name and a value.

    So, for your example, with an attribute added:

    • Element: <thisIsAKey attrname="attrval">andThisIsItsValue</thisIsAKey>
    • Element name: thisIsAKey
    • Start tag: <thisIsAKey>
    • End tag: </thisIsAKey>
    • Content: andThisIsItsValue
    • Attribute: attrname="attrval"
    • Attribute name: attrname
    • Attribute value: attrval