-
Notifications
You must be signed in to change notification settings - Fork 4
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
Error in mapping_rule.rb
when running .to_xml
with an element with same name in attribute and element
#217
Comments
@ronaldtse Currently, we are processing the input data into a Consider the following case:
Mapping Hash will be:
So, I am considering separating the elements and attributes in a nesting structure within the hash.
NOTE: This approach might break existing Should we go with this approach? What do you suggest? |
Hi @ronaldtse, do you think we solve this issue by the quoted approach? |
@HassanAkbar I think XML attributes and XML elements should definitely be handled separately, so the proposed approach seems reasonable. Re: this approach may break custom methods
We do have to remember that other key-value pair serialization methods do not distinguish "attribute" and "element" though. P.S. This is a blocker for this task: |
Ping @kwkwan this issue is now fixed. |
Refer to https://github.com/lutaml/xmi/blob/main/spec/fixtures/ISO%206709%20Edition%202.xml, some node like
ownedComment
may haveannotatedElement
as anattribute
or as anelement
.i.e.
or
Suppose we have class definitions like:
When we run
OwnedComment.from_xml
like:Error will occur like the following output:
It seems that the
mapping_rule
cannot distinguishannotatedElement
whether it is anattribute
orelement
and it try to output XML in wrong way.The text was updated successfully, but these errors were encountered: