function startElement($parser, $tagName, $attrs) { switch ($tagName) { case "EQUIPMENT": $equipment = new Equipment(); $equipment->parse($parser, $this); $this->equipment[] = $equipment; break; default: break; } }
function startElement($parser, $tagName, $attrs) { $this->tag = $tagName; switch ($tagName) { case "HOPS": $hops = new Hops(); $hops->parse($parser, $this); $this->hops = $hops; break; case "FERMENTABLES": $fermentables = new Fermentables(); $fermentables->parse($parser, $this); $this->fermentables = $fermentables; break; case "YEASTS": $yeasts = new Yeasts(); $yeasts->parse($parser, $this); $this->yeasts = $yeasts; break; case "STYLE": $style = new Style(); $style->parse($parser, $this); $this->style = $style; break; case "MASH": $mash = new Mash(); $mash->parse($parser, $this); $this->mash = $mash; break; case "WATER": // beerXML SPEC DOES NOT INCLUDE A WATERS TAG, ONLY WATER...BEERSMITH IS IMPLEMENTING INCORRECTLY $water = new Waters(); $water->parse($parser, $this); $this->water = $water; break; case "MISCS": $miscs = new Miscs(); $miscs->parse($parser, $this); $this->miscs = $miscs; break; case "EQUIPMENT": // SKIPPING EQUIPMENTS OBJECT AS BEERSMITH DOES NOT IMPLEMENT CORRECTLY $equipment = new Equipment(); $equipment->parse($parser, $this); $this->equipments = $equipment; break; default: break; } }