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

Creating EML elements with XML attributes #338

Open
kzollove opened this issue Apr 20, 2022 · 2 comments
Open

Creating EML elements with XML attributes #338

kzollove opened this issue Apr 20, 2022 · 2 comments
Assignees

Comments

@kzollove
Copy link

The ezEML web app for creating EML adds an additional metadata tag to every EML document that describes the editor used to create it:

<additionalMetadata>
    <metadata>
      <emlEditor app="ezEML" release="2022.04.13">
      </emlEditor>
    </metadata>
  </additionalMetadata>

We're trying to recreate this in EMLassemblyline using the EML/emld R package framework. We are able to create app and release as child elements of emlEditor, but not as attributes:

IN:

EML::eml$additionalMetadata(
      metadata = list(emlEditor = list(
        "app" = "EMLassemblyline",
        "release" = "2022.04.13")))

OUT:

<additionalMetadata>
    <metadata>
      <emlEditor>
		<app>EMLassemblyline</app>
		<release>2022.04.13</release>
      </emlEditor>
    </metadata>
  </additionalMetadata>

Is it possible to specify XML attributes within the EML/emld framework (we've tried many different ways?

If not, could this be implemented? Possibly to work like:

IN:

EML::eml$additionalMetadata(
      metadata = list(emlEditor = list(
        "@app" = "EMLassemblyline",
        "@release" = "2022.04.13")))

OUT:

<additionalMetadata>
    <metadata>
      <emlEditor app="EMLassemblyline" release="2022.04.13">
      </emlEditor>
    </metadata>
  </additionalMetadata>
@amoeba
Copy link
Collaborator

amoeba commented Apr 21, 2022

Hi @kzollove,

I think you're right that there's not a way to do this right now. The only list names that get treated as attributes are ones that are part of the EML schema.

That said, supporting this wouldn't be too hard and I think it'd be useful. The workaround would be to serialize your EML as XML and set your additionalMetadata element using XML-aware tools (like xml2). Not a great solution.

Thoughts, @cboettig, maybe @jeanetteclark? I kinda like how having a leading "@" before a name looks here.

@peterdesmet
Copy link
Member

Would very much like this too! I like the @attribute syntax, similar to how @id is currently set.

@amoeba amoeba self-assigned this May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants