Skip to content

Commit

Permalink
Prevent errors from invalid XPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
pleonex committed Dec 5, 2015
1 parent b1291db commit 142a3a3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
npm-debug.log
node_modules
.imdone
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.7.5
* Merge attributes from extension types.
* Throw errors to console to not annoy the user.
* Prevent error from invalid XPaths.

## 0.7.4
* Fix using a root type as children too.
Expand Down
2 changes: 1 addition & 1 deletion lib/xsd.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports =
type = xsdParser.roots[xpath[0]]
xpath.shift() # Remove root node.

while xpath && xpath.length > 0
while xpath && xpath.length > 0 && type
nextTag = xpath.shift()
nextTypeName = @findTypeFromTag nextTag, type
type = @types[nextTypeName]
Expand Down
3 changes: 1 addition & 2 deletions lib/xsdParser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ module.exports =

# TODO: Process all Attributes definition.
# TODO: Process all AttributeGroup
# TODO: Process all Group

# Post parse the nodes and resolve links.
@postParsing()

console.log @types
# Return calling the complete callback.
complete()


Expand Down

0 comments on commit 142a3a3

Please sign in to comment.