Jens Oliver Meiert

Notes on XML, Elements, and Attributes

Post from April 23, 2009 (↻ June 5, 2021), filed under .

This and many other posts are also available as a pretty, well-behaved ebook: On Web Development.

Contrary to what one might expect, I’m not bringing in much XML design experience with my occasional contributions to the HTML 5 specification. However, knowledge of the design of markup languages is something I consider beneficial for my job as a web professional as well. A few notes on XML design, inspired by internal and external documentation:

Update (November 27, 2014)

I found Uche Ogbuji’s article on principles of XML design useful, too. For example:

Tweet this? (If it changed your life, you delight me with a coffee.)

About Me

Jens Oliver Meiert, on April 29, 2020.

I’m Jens Oliver Meiert, and I’m an engineering manager and author. I’ve worked as a technical lead for Google, I’m close to the W3C and the WHATWG, and I write and review books for O’Reilly. Other than that, I love trying things, sometimes including philosophy, art, and adventure. Here on I share some of my views and experiences.

If you have questions or suggestions about what I write, please leave a comment (if available) or a message.

Comments (Closed)

  1. On April 23, 2009, 23:15 CEST, Steffen said:

    My thoughts on that considering only the information structure aspects of the document:

    As long as the information is and stays flat, I would prefer an attribute for brevity.

    If information is extensible in nature (concerning cardinality and depth) you should opt for an element, which also contributes to simplification of validation (thinking of xsd or dtd).

    That said, I can’t resist to state that the style attribute must be considered as an anti pattern (I know, you will like that, Jens 😉), looking at sth. like style=”a: 1; b: 2; c: url(y) #3 […];’. It’s ignoring the (x/ht)ml grammar and starts a completely new one instead of using means of XML.

    I wonder, if this would still be the design of choice today with the growing popularity of extensible (in terms of namespaces) documents - neglecting all backward compatibility and nostalgic feelings 😉.

  2. On April 24, 2009, 15:10 CEST, Jens Oliver Meiert said:

    Interesting, thanks Steffen! Would be lovely to hear some thoughts on that from other HTML WG members—and I can follow, but not comment on the history of @style.

Read More

Have a look at the most popular posts, possibly including:

Looking for a way to comment? Comments have been disabled, unfortunately.

Cover: The Web Development Glossary.

Perhaps my most comprehensive book: The Web Development Glossary (2020). With explanations and definitions for literally thousands of terms from Web Development and related fields, building on Wikipedia as well as the MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.

Stay up-to-date? Follow me by feed or on Twitter.

Found a mistake? Email me,

You are here: HomeArchive2009 → Notes on XML, Elements, and Attributes

Last update: June 5, 2021

Professional frontend developers produce valid HTML and CSS.