You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the class definition is generated by Shale::Schema.from_xml([schema]) using the above mentioned schema, the class will look like:
class Address < Shale::Mapper
attribute :content, Shale::Type::String
attribute :city, Shale::Type::String
attribute :zip, Shale::Type::String
xml do
root 'Address'
map_content to: :content
map_element 'City', to: :city
map_element 'ZIP', to: :zip
end
end
However, when the class definition is generated by Lutaml::Model::Schema::XmlCompiler.to_models(schema) using the same schema, the class will look like:
class Address < Lutaml::Model::Serializable
attribute :city, String, collection: true
attribute :zip, String, collection: true
xml do
root "Address", mixed: true
map_element :City, to: :city
map_element :ZIP, to: :zip
end
end
When we use the class definition generated by Lutaml::Model to parse the address:
Consider we have address schema like:
and address content looks like:
When the class definition is generated by
Shale::Schema.from_xml([schema])
using the above mentioned schema, the class will look like:However, when the class definition is generated by
Lutaml::Model::Schema::XmlCompiler.to_models(schema)
using the same schema, the class will look like:When we use the class definition generated by
Lutaml::Model
to parse the address:The content "Oxford Street" will be missing.
The text was updated successfully, but these errors were encountered: