Skip to content

Commit

Permalink
Merge extension attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
pleonex committed Dec 5, 2015
1 parent d3510a8 commit b069d50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.7.5
* Merge attributes from extension types.

## 0.7.4
* Fix using a root type as children too.
* Missing "uuid" dependency
Expand Down
7 changes: 4 additions & 3 deletions lib/xsdParser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,18 @@ module.exports =
for name, type of @types
# If the children type is extension, resolve the link.
if type.xsdChildrenMode == 'extension'
extensionType = type.xsdChildren
extenType = type.xsdChildren
extenAttr = (@parseAttribute xattr for xattr in extenType.attribute)

# Copy fields from base
linkType = @types[extensionType.$.base]
linkType = @types[extenType.$.base]
type.xsdTypeName = linkType.xsdTypeName
type.xsdChildrenMode = linkType.xsdChildrenMode
type.xsdChildren = linkType.xsdChildren
type.xsdAttributes = extenAttr.concat linkType.xsdAttributes
type.description ?= linkType.description
type.type = linkType.type
type.rightLabel = linkType.rightLabel
# TODO: Add extensions (e.g.: attributes)

# If it's a group, resolve the link
else if type.xsdChildrenMode == 'group'
Expand Down

0 comments on commit b069d50

Please sign in to comment.