-
Notifications
You must be signed in to change notification settings - Fork 2
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
(URGENT) XML not being read in from custom model #117
Comments
@HassanAkbar @suleman-uzair has this PR fixed this issue? |
#119 will not fix this issue; it was for a separate issue that occurred when using custom models with the |
Got it. |
@HassanAkbar so #126 fixes part of this problem but not fully? |
@ronaldtse It fixes the crash and adds an internal representation of the node to the mapping hash. So I think this problem is fully solved by #126. @opoudjis Is there something else needed for this ticket? |
The latest gem is released for this. @opoudjis could you please help try if this works? Thanks. |
Another blocker.
Consider the following code, which uses an externally defined class for content:
And I am not going to come up with a simple test class instead of ::RelatonBib::BibliographicItem, because after three months of this, I'm not going to spend an extra couple of hours doing mockups.
The custom model is working fine for reading YAML, via ::Relaton::Cli::YAMLConvertor.convert_single_file(value). Both the YAML and the XML outputs work.
The custom model fails to read the XML, other than the schema-version attribute: all it outputs is:
In Lutaml::Model::Serialize::ClassMethods#apply_mappings, doc.to_xml has bibdata in it intact:
And the conversion to mapping_hash in
preserves the content:
I sure this is going wrong because of the foundational problem with mapping_hash which I have pointed out, that it does not cope with mixed content, or with leading whitespace. The complication here is that this is not happening when writing XML, but when reading XML: mapping_hash preserves the information ostensibly from the foregoing, but just doesn't pass it on to serialisation though
apply_mappings(doc_hash, format)
.In fact, when I make
which should be coping with mixed content, not only does XML > YAML fail to output the bibdata, but XML > XML crashes:
The text was updated successfully, but these errors were encountered: