We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mixed: true
When I try to parse the following XML:
<math> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> </math>
Using the following code:
require 'lutaml/model' Lutaml::Model::Config.configure do |config| require 'lutaml/model/xml_adapter/nokogiri_adapter' config.xml_adapter = Lutaml::Model::XmlAdapter::NokogiriAdapter end class Mi < Lutaml::Model::Serializable attribute :value, :string xml do root "mi" map_content to: :value end end class Mo < Lutaml::Model::Serializable attribute :value, :string xml do root "mo" map_content to: :value end end class Mrow < Lutaml::Model::Serializable attribute :mi, Mi attribute :mo, Mo xml do root "mrow", mixed: true map_element :mi, to: :mi map_element :mo, to: :mo end end class Mathml < Lutaml::Model::Serializable attribute :mrow, Mrow, collection: true xml do root "math", mixed: true map_element :mrow, to: :mrow end end Mathml.from_xml("<math><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow></math>") > #<Mathml:0x0000000104879308 @element_order=["mrow"], @mrow= [#<Mrow:0x0000000104872670 @element_order=["mi", "mo", "mi"], @mi= [#<Mi:0x000000010485d568 @element_order=["text"], @ordered=nil, @validate_on_set=false, @value="x">, #<Mi:0x00000001049589e0 @element_order=["text"], @ordered=nil, @validate_on_set=false, @value="y">], @mo=#<Mo:0x00000001047fa0d0 @element_order=["text"], @ordered=false, @validate_on_set=false, @value="+">, @ordered=true, @validate_on_set=false>], @ordered=true, @validate_on_set=false>
How can I get the output formula as mi(x), mo(+), mi(y) and not mi(x), mi(y), mo(+)? is there anything I can do using mixed option?
mi(x)
mo(+)
mi(y)
mixed
The text was updated successfully, but these errors were encountered:
@suleman-uzair is this addressed?
Sorry, something went wrong.
is this addressed?
@ronaldtse, No, it’s not addressed yet.
HassanAkbar
No branches or pull requests
When I try to parse the following XML:
Using the following code:
How can I get the output formula as
mi(x)
,mo(+)
,mi(y)
and notmi(x)
,mi(y)
,mo(+)
? is there anything I can do usingmixed
option?The text was updated successfully, but these errors were encountered: