Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Multiple properties should be parsed, rather than use only the first valid #3

@RCheesley

Description

@RCheesley

The problem

If you wish to declare multiple properties for an item, you should be able to do so using itemprop="property1 property2 property3".

With the current setup, only property1 would be parsed and the rest discarded. It might also be the case that I have a specific property which is in something other than position 1, and if the item in position 1 is valid they will never be parsed.

Source: http://www.w3.org/TR/2009/WD-html5-20090825/microdata.html

Example:

An element introducing a property can also introduce multiple properties at once, to avoid duplication when some of the properties have the same value.

Here we see an item with two properties, "favorite-color" and "favorite-fruit", both set to the value "orange":

<div item>
<span itemprop="favorite-color favorite-fruit">orange</span>
</div>

Example use 'in the wild'

http://www.seatrade-global.com/news/americas/would-selling-apl-logistics-be-good-for-nol.html

<span itemprop="CopyrightHolder publisher provider">Seatrade Communications Limited</span>

http://www.google.com/webmasters/tools/richsnippets?q=http%3A%2F%2Fwww.seatrade-global.com%2Fnews%2Famericas%2Fwould-selling-apl-logistics-be-good-for-nol.html

This validates as:

copyrightholder: Seatrade Communications Limited
publisher: Seatrade Communications Limited
provider: Seatrade Communications Limited

Possible workarounds

Perhaps consider some kind of logic which states if the first item is valid, use it, then check other items and add them if they are valid, exclude if they are not. If the first item is not valid it should naturally move to the next one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions