-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improve handling of XML attributes and element values. #394
Conversation
@@ -192,11 +211,11 @@ public void endEntity() { | |||
|
|||
@Override | |||
public void literal(final String name, final String value) { | |||
if (name.isEmpty()) { | |||
if (name.isEmpty() || name.equals(valueTag)) { |
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.
We could also set DEFAULT_VALUE_TAG = ""
and drop name.isEmpty()
.
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.
+1 simplify if you can ... did that as sideeffect of d9ba206.
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.
This won't actually change the behaviour due to SimpleXmlEncoder.Element.writeElement()
. But I think we should do it anyway, so we get our semantics straight.
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.
Thx, I think this is very nice!
I added a commit to reuse some variables, but I am not sure if this is good, especially the direct reference of DefaultXmlPipe
in SimpleXmlEncoder
. You may skip the commit (as we don't have an official contributing.md yet and we are the only one working on it you may use force push).
d9ba206
to
d6e68ff
Compare
I like the sentiment, thanks. But I see two issues with it:
We don't? I thought that's what #375 was. How does it become official? (Not that I mind, though... the rebase ban is one of my major grievances with these guidelines 😉) |
+1 right
ack
ups, right! Well maybe I had slumbering in my mind that you are not so fond of it ...
but we don't ban it at a whole ... might you want to read again https://github.com/metafacture/metafacture-core/blob/master/CONTRIBUTING.md#force-pushing and discuss your concerns (maybe via email)? |
Make attribute markers configurable:
Make value tag names configurable:
Fixes #379.
Related to #336.