JuliaCloud / XMLDict.jl

XMLDict implements a simple Associative interface for XML documents.
Other
33 stars 11 forks source link

Switch to EzXML, fix 0.7 deprecations #11

Closed ararslan closed 6 years ago

ararslan commented 6 years ago

Still a work in progress, want to make sure CI and everything agrees

ararslan commented 6 years ago

Requires https://github.com/bicycle1885/EzXML.jl/pull/73.

ararslan commented 6 years ago

When checking out my branch here and Kenta's branch from his EzXML PR, things mostly work, but we instead run into an issue of fields appearing in a different order. In particular, in the loop at the end of test/runtests.jl, the xml2 value is normalized as

<?xml version="1.0"?>
<GetUserResponse>
  <GetUserResult>
    <User>
      <PasswordLastUsed>2015-12-23T22:45:36Z</PasswordLastUsed>
      <Arn>arn:aws:iam::012541411202:root</Arn>
      <UserId>012541411202</UserId>
      <CreateDate>2015-09-15T01:07:23Z</CreateDate>
    </User>
  </GetUserResult>
  <ResponseMetadata>
    <RequestId>837446c9-abaf-11e5-9f63-65ae4344bd73</RequestId>
  </ResponseMetadata>
</GetUserResponse>

whereas the normalization of the string created from the dict-parsed xml2 is

<?xml version="1.0"?>
<GetUserResponse>
  <GetUserResult>
    <User>
      <Arn>arn:aws:iam::012541411202:root</Arn>
      <UserId>012541411202</UserId>
      <PasswordLastUsed>2015-12-23T22:45:36Z</PasswordLastUsed>
      <CreateDate>2015-09-15T01:07:23Z</CreateDate>
    </User>
  </GetUserResult>
  <ResponseMetadata>
    <RequestId>837446c9-abaf-11e5-9f63-65ae4344bd73</RequestId>
  </ResponseMetadata>
</GetUserResponse>

Note the ordering within <User>: for no apparent reason, PasswordLastUsed gets put third instead of first.

samoconnor commented 6 years ago

HI @ararslan.

On my system, with Julia 0.6.4, your EzXML port passes all the tests with this change: https://github.com/invenia/XMLDict.jl/pull/1

bicycle1885 commented 6 years ago

The new version of EzXML.jl (https://github.com/bicycle1885/EzXML.jl/releases/tag/v0.7.0) includes the version and encoding accessors.

ararslan commented 6 years ago

Thanks for submitting that change, @samoconnor, and thank you @bicycle1885 for tagging a new EzXML release!

Looks like on 0.7 the ordering issue I noted above is still happening. I'm not clear on why yet.

ararslan commented 6 years ago

It looks like the return type for filter(f, ::OrderedDict) changed between 0.6 and 0.7. In 0.7, it returns a Dict rather than another OrderedDict, which causes unpredictable ordering for iteration.

ararslan commented 6 years ago

I had to work around an issue in DataStructures. I'll submit a PR to fix things there, but in the meantime can we go ahead with this?

ararslan commented 6 years ago

DataStructures PR: https://github.com/JuliaCollections/DataStructures.jl/pull/401

ararslan commented 6 years ago

Thanks! Could I trouble you for a new tag as well? 🙂

samoconnor commented 6 years ago

See:

https://github.com/samoconnor/XMLDict.jl/releases/tag/v0.2.0

https://github.com/JuliaLang/METADATA.jl/pull/15897