Rectangle 27 0

html5 Best practice for meta data in a html document?


<!DOCTYPE html>
<html>
<head
    data-details="52:AS6[rxSdsMd4RgYXJgeabsRAVBZ:0406139009]" 
    data-policyId="1234567890"
    data-partyId="0987654321"
    data-emailAddress="user@email.com"
    data-error="49"
    data-subsessionid="bffd5bc0-a03e-42e5-a531-50529dae57e3">
</head>
<!DOCTYPE html>
<html>
<head itemscope>
  <meta itemprop="details" content="52:AS6[rxSdsMd4RgYXJgeabsRAVBZ:0406139009]" />
  <meta itemprop="policyId" content="1234567890" />
  <meta itemprop="partyId" content="0987654321" />
  <link itemprop="emailAddress" href="mailto:user@email.com" /> <!-- or use a meta element if you dont want to provide a full URI with "mailto:" scheme -->
  <meta itemprop="error" content="49" />
  <meta itemprop="subsessionid" content="bffd5bc0-a03e-42e5-a531-50529dae57e3" />
</head>
<!DOCTYPE html>
<html>
<head>
  <script type="text/plain">
    details = 52:AS6[rxSdsMd4RgYXJgeabsRAVBZ:0406139009]
    policyId = 1234567890
    partyId = 0987654321
    emailAddress = user@email.com
    error = 49
    subsessionid = bffd5bc0-a03e-42e5-a531-50529dae57e3
  </script>
</head>
application-name

No need for a meta element.

The script element can be used for data blocks. You can choose any format that suits your needs. Example with plain text:

When trying the <meta itemprop="key" content="value" /> method, do not forgot to set itemscope in the head tag. Otherwise it fails validation on the w3c validator stating "The itemprop attribute was specified, but the element is not a property of any item.". Took me some time to figure that one out!

While your example may work, note that the keyword application-name is for Web applications only.

You could create a vocabulary, but thats not required for local use.

Note
Rectangle 27 0

html5 Best practice for meta data in a html document?


<meta data-details="52:AS6[rxSdsMd4RgYXJgeabsRAVBZ:0406139009]" data-policyId="0123456789" />

Thanks Rich - I'm going to go with a slight variant to your answer (I'll post it as an answer in a moment), but I've marked your answer as the accepted answer as it was yours that pointed me in the right direction :)

W3C validation is meaningless. HTML != XML, so there isn't any schema to validate it. No browser will choke because you added a meta element with an unregistered name. If you really are worried, you could use the data attribute on a meta element like:

Note
Rectangle 27 0

html5 Best practice for meta data in a html document?


<meta data-name="details" content="52:AS6[rxSdsMd4RgYXJgeabsRAVBZ:0406139009]" />

So you could reference to that data-name to work with your meta stuff...

What if you try using the data- format to add a custom attribute to them, something like data-type or data-name and omitting the real name attribute or maybe setting it all to "abstract" or something (I donno if the validator will give problems for repeated meta names):

Note