Skip to content

Commit

Permalink
Merge pull request evt-project#104 from evt-project/bugfix/addition-w…
Browse files Browse the repository at this point in the history
…ithout-place

Fix AdditionParser when element does not have a place attribute
  • Loading branch information
szenzaro authored Nov 27, 2020
2 parents 237559b + 49fba39 commit 15f741c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/app/services/xml-parsers/basic-parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,10 @@ export class GapParser extends EmptyParser implements Parser<XMLElement> {
export class AdditionParser extends EmptyParser implements Parser<XMLElement> {
elementParser = createParser(ElementParser, this.genericParse);
attributeParser = createParser(AttributeParser, this.genericParse);
parse(xml: XMLElement): Addition | GenericElement {
const place = xml.getAttribute('place') as PlacementType;
if (!place) {
return this.elementParser.parse(xml);
}

parse(xml: XMLElement): Addition {
return {
type: Addition,
place,
place: xml.getAttribute('place') as PlacementType,
path: xpath(xml),
content: parseChildren(xml, this.genericParse),
attributes: this.attributeParser.parse(xml),
Expand Down

0 comments on commit 15f741c

Please sign in to comment.