-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix xml namespace/element/type handling #756
Conversation
The changes look very promising. I have a couple of questions:
|
It's related to item 3 to dedup the prefix/uri declarations at child levels. |
@@ -89,6 +89,18 @@ wsdlStrictTests['should handle element ref'] = function(done) { | |||
}); | |||
}; | |||
|
|||
wsdlStrictTests['should handle type ref'] = function(done) { | |||
var expectedMsg = require('./wsdl/typeref/request.xml.js'); | |||
var req_json = require('./wsdl/typeref/request.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camelCase variable name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Have you provided tests for this? |
Why weren't these failing before? |
If the code fails to look up a schema object by name, it assumes that element is under the parent namespace. And it works by coincidence. |
9f398f0
to
087ec8f
Compare
I fixed the camelCase and nesting sequence. |
This will attempt to fix circular dependencies with XSD files, | ||
Given | ||
|
||
file.wsdl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this formatting, but see now that each line should start with *
. Can you add that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's messed up from the merge.
Overall it looks good to me. I'd just go through it and ensure that each change was intended (no auto indending etc.). I'd also like @herom to review this. |
087ec8f
to
e284d58
Compare
@jsdevel Thanks for the review. I'm still not happy about the JSON to XML object mapping as-is. The |
@@ -6,9 +6,11 @@ | |||
"use strict"; | |||
|
|||
function findKey(obj, val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract this out into a utility file? I see that it's duplicated in lib/server.js
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
I hear you.
Couldn't agree more. |
e284d58
to
d0bf6ff
Compare
Fix xml namespace/element/type handling
Another great PR @raymondfeng ! Thank you! |
…ment Fix xml namespace/element/type handling
/to @jsdevel
The PR improves the XML namespace handling for JSON to XML transformation.
NamespaceContext
class inlib/nscontext.js
to keep track of namespace prefix/uri mappings and declarations in the hierarchy.xmlns:prefix=uri
sequence
can be a child element ofsequence
.Please review.