-
Notifications
You must be signed in to change notification settings - Fork 1
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 round-tripping specs #1
Comments
We may need to use the These are enhancements we need in lutaml-model:
Ping @HassanAkbar @suleman-uzair for thoughts. |
So I fixed the "native round-trip spec" but there is a problem with In the XML file, it contains this content (the spec passes if I comment that line out): <row>
<entry>b1</entry>
<entry>b2</entry>
<entry>b3</entry>
<entry>b4</entry>
<entry morerows='1' valign='middle'><para> <!-- Pernicous Mixed Content -->
Vertical Span</para></entry>
</row> The element This is a case where the content of an element is not defined, and we need to implement some pass-through. Clearly, So I thought of using module Oasis
module Etm
class Entry < Lutaml::Model::Serializable
attribute :colname, :string
attribute :content, :string, raw: true
# ...
xml do
root "entry"
# Attribute mappings
map_attribute "colname", to: :colname
# ...
# Content mapping
map_content to: :content
end
end
end
end But it still doesn't work. We need to handle this case gracefully because it is a clear requirement. |
The above problem depends on this fix: |
Ping @HassanAkbar @suleman-uzair for comments. |
@ronaldtse There're only two specs keep failing now, but shouldn't they be put in |
So different XML schemas use the same OASIS table XML, but use different namespaces. The tests from "isosts" are also from "isosts", which is an older XML schema that adopted the OASIS table XML. I suspect that we should allow an easy way to accept different namespaces? |
@ronaldtse Yeah, we need to change |
@ronaldtse @HassanAkbar It's like we may need something like in |
@Novtopro Good idea. This might work, I'll try working on this and see if it affects other specs or not. Actually, I think we are doing it for the first level, not sure about passing it down to other elements. I'll check this and get back to you. |
Failures:
The round-tripping specs are failing for a few reasons:
xmlns:oasis="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
. By default the Table class does not use any namespace. We need to update the specs (with a wrapping class) to work with this additional namespace.xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table"
. We need to update the specs (new wrapping class) to parse this.native/
file is failing as element order is necessary in the table. For text cells, we need to applymixed: true
. For elements with order sensitive children, apply theorder: true
option.The text was updated successfully, but these errors were encountered: