Skip to content
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

Handling raw HTML as field values in XML formats #106

Open
ronaldtse opened this issue Oct 17, 2024 · 1 comment
Open

Handling raw HTML as field values in XML formats #106

ronaldtse opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@ronaldtse
Copy link
Contributor

We've just come across an example of embedding raw HTML inside XML.

The NIST OSCAL Metaschema allows embedding HTML inside XML as documentation.

This is the exact use case for using the raw option for an attribute.

From:

@HassanAkbar can we confirm that this use case is supported by raw? Thanks!

@ronaldtse ronaldtse added the question Further information is requested label Oct 17, 2024
@HassanAkbar
Copy link
Member

HassanAkbar commented Oct 18, 2024

@ronaldtse Currently, we can use the raw tag for this by adding it to each attribute we define, like attribute:remarks, raw: true, but for the current implementation, we will have to define raw: true everywhere.
We can have something like as discussed here #57 (comment), or we can provide raw: true at root level for an attribute like

class Remark < Lutaml::Model::Serializeable
  attribute :raw_content

  xml do
    root "remarks", raw: true

    map_content to: :raw_content
  end
end

@ronaldtse What do you suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants