Added parsing of itemid

master
Ian Davis 2012-06-07 15:41:50 +01:00
parent 93774ea600
commit a58ae8f1fe
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ type PropertyMap map[string]ValueList
type Item struct { type Item struct {
properties PropertyMap properties PropertyMap
types []string types []string
id string
} }
func NewItem() *Item { func NewItem() *Item {
@ -77,7 +78,10 @@ func (self *Parser) scanForItem(node *h5.Node) {
item.types = append(item.types, itemtype) 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)
}
} }