From a58ae8f1fe6312c7649b68881d1d262d88839119 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Thu, 7 Jun 2012 15:41:50 +0100 Subject: [PATCH] Added parsing of itemid --- microdata.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/microdata.go b/microdata.go index e73eb1a..a6b9a7d 100644 --- a/microdata.go +++ b/microdata.go @@ -15,6 +15,7 @@ type PropertyMap map[string]ValueList type Item struct { properties PropertyMap types []string + id string } func NewItem() *Item { @@ -77,7 +78,10 @@ func (self *Parser) scanForItem(node *h5.Node) { item.types = append(item.types, itemtype) } } - + // itemid only valid when itemscope and itemtype are both present + if itemid, exists := getAttr("itemid", node); exists { + item.id = strings.TrimSpace(itemid) + } }