Skip to content

Use inline style for rendering #331

Closed

Description

Dear Sie/Madame:

I am an employee at INM-6, Forschungszentrum Jülich. We use odml schema for data description.

I am writing to you to propose a method for rendering locally stored odml file, with inline style.

The problem is, locally stored odml files can not be rendered properly any more in new version of common browser softwares with the external odml.xsl. However they can be rendered using inline style. I tested it and it works fine.

The inline style sheet integration can be done like:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="#stylesheet"?>
<!DOCTYPE odML
[
	<!ATTLIST xsl:stylesheet
	id ID #REQUIRED>
]>
<odML version="1">
  <xsl:stylesheet id="stylesheet"
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match="odML">
      <xsl:variable name="repository" select="repository"/>
      <html>
        <!-- <head> //-->
          <style type="text/css">
            Here style sheets
          </style>
        <!-- </head> //-->
        <body>
          Here HTML body
        </body>
      </html>
    </xsl:template>
Followed by odml tags

This kind of inline styled odml files work directly in Firefox.
For Chrome "application/xml" must be registered in Mime-type database for .odml extension.

Best regards,
Sun

Activity

  1. mpsonntag commented on Oct 28, 2019

    @mpsonntag
    Contributor

    Hi sun, thanks a lot for the issue, this looks like a really nice solution for local viewing of odML files.

    We will check the approach and see if we can include it in the next release.

  2. morales-gregorio commented on Jan 21, 2020

    @morales-gregorio

    Hey all,

    I was just discussing this issue with @sunfzjuelich, @JuliaSprenger and @mdenker beacuse it would be really cool to have a locally viewable file directly coming out from odml!

    A solution similar to the way @sunfzjuelich integrated the stylesheet in odml would be perfect for me, since I am working on a data publication that is in its final stages. It would be really helpful to have odml metadata to be viewable in any browser for the publication. It would make odml so much more useful for our target audience (who are potentially windows/mac based and not too keen on python).

    All best,
    Aitor

  3. mpsonntag commented on Jan 21, 2020

    @mpsonntag
    Contributor

    @sunfzjuelich, @morales-gregorio, I just finished implementing a prototype but am still working out the kinks. I'll try to release a version until the end of the week.

  4. morales-gregorio commented on Jan 21, 2020

    @morales-gregorio

    Sounds awesome! :)

  5. mpsonntag commented on Jan 23, 2020

    @mpsonntag
    Contributor

    @sunfzjuelich @morales-gregorio I just released a new odml version on PyPI containing the inline style option.

  6. morales-gregorio commented on Jan 30, 2020

    @morales-gregorio

    Just tried it and it works like a charm! From my side this solves the issue.
    Thanks a lot!

  7. ghost closed this as completedon Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions