esdscom / sdscom-xml

Schema definition and other documents of eSDScom (formerly SDScom and ESCom), the standard for electronic exchange of Safety Data Sheets in a structured, processible way across Europe and other regions. Please read the wiki for more info. All work is licensed under CC BY-ND 4.0 (https://creativecommons.org/licenses/by-nd/4.0/legalcode)
https://www.esdscom.eu
27 stars 6 forks source link

stylesheet for SDSComXML version 4.4 and 4.2 #58

Open Henrich-BGRCI opened 8 years ago

Henrich-BGRCI commented 8 years ago

With this issue I want to release the new stylesheet EDASxChem_style_v4.txt for displaying SDScomXML files. At least all fields defined for EDASxChem 4.2.1.1 are included.

For usage you have to change the file name to EDASxChem_style_v4.xslt and to add the following lines at the beginning of your SDScomXML file followed by the part:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="EDASxChem_style_v4.xslt"?>
<DatasheetFeed  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sdscomxml.eu/421/sdscomxml.xsd">

You are invited to test and discuss it and to report any bugs. On the long term run, I want to include more fields.

EDASxChem_style_v4.txt

dirk-qualisys commented 8 years ago

May we treat this as an imcomplete, yet common SDScom stylesheet? I suggest to rename it and make it part of the deliverables, i.e. have it maintained and published with each SDScom release.

nils-eska commented 8 years ago

Good work, but as long as this stylesheet does not contain the full SDScom scope, this should be only part of the SDBTransfer project. We should not mix the projects and the different scopes.

dirk-qualisys commented 8 years ago

I think we need to find a common understanding here. As SDScom substandards, EDASxBau and EDASxChem cover parts of SDScom. I agree with Nils that the template should not be part of the releases if it is meant to cover (one of) those substandards only, but shouldn't we take this as the starting point to develop a complete stylesheet? In that case, we are talking about an SDScom template which is added now for further development. This would be my preference, and I am certainly willling to contribute to the template.

dirk-qualisys commented 8 years ago

Mr Henrich today attached an updated stylesheet to issue #69.

dirk-qualisys commented 8 years ago

As agreed in today's steering committee meeting, a full-blown SDScom stylesheet should be developed as part of the SDScom delivery. This stylesheet will be enhanced with remarks and editing hints so that it can replace the "BDI template" on the long-term. A new issue will be opened for this SDScom stylesheet.

Henrich-BGRCI commented 8 years ago

Just a new update of the style sheet: EDASxChem_style.release20160426.txt

Rename the file ending to .xslt.

dirk-qualisys commented 8 years ago

Thank you! We can leave this issue open for further stylesheet updates until we create an SDScom stylesheet as described in issue #82.

dirk-qualisys commented 5 years ago

@Henrich-BGRCI , do you agree to use your stylesheet as the starting point for a full SDScom stlesheet under our Creative Commons license? You have a copyright remark in your stylesheet that would contradict this.

If you agree, I would take your latest stylesheet version, remove the German description and replace it with our usual license link and integrate it into 5.0. Please confirm or object in this issue.

SmolSoftBoi commented 3 years ago

I started creating my own style sheet if this would help: https://github.com/EpicKris/sdscom-xsl

dirk-qualisys commented 2 years ago

Closed since Kris's stylesheet covers this. Thanks again!

Henrich-BGRCI commented 2 years ago

Here, I present a new stylesheet "SDSComXML Viewer" for covering most parts of SDSComXML version 4.4.0.2 and 4.2. The new stylesheet is published under http://creativecommons.org/licenses/by-sa/4.0/ SDScomXMLViewer_1.0.zip

"SDSComXML Viewer" consists of five parts: SDSComXMLVierw.xslt: main part for reading depending files SDSComXMLVierwCT.xslt: templates for the different sections of the safety datasheet SDSComXMLVierwDT.xslt: templates according to the datatypes of the SDSComXML schema SDSComXMLVierwMap.xslt: variable definition for translating SDScomXML element names into German SDSComXMLVierw.css: CSS for formating the output html

To make the stylesheet more flexible and adaptable to changes in XSD, the schema files are loaded by the stylesheet. In principal, by modifying the files SDSComXMLVierwCT.xslt and SDSComXMLVierwDT.xslt, the stylesheet should be easily adaptable to SDSComXML version 5.

For converting SDSComXML into html you can use e.g. SaxonHE11-1J: java -cp SaxonHE11-1J\saxon-he-11.1.jar net.sf.saxon.Transform -t -xsl:SDSComXMLViewer.xslt -o:example.html -s:3.xml

SmolSoftBoi commented 2 years ago

Here, I present a new stylesheet "SDSComXML Viewer" for covering most parts of SDSComXML version 4.4.0.2 and 4.2. The new stylesheet is published under http://creativecommons.org/licenses/by-sa/4.0/ SDScomXMLViewer_1.0.zip

We have a stylesheet already: https://github.com/esdscom/esdscom-xsl

Henrich-BGRCI commented 2 years ago

I know, but I started the programming for this stylesheet long time ago and just finished it (see my workshop slides from 2021).

As far as I can see from your code, it covers just a few sections and datatypes (so far, I wasn't able to run it). Whereas, in the stylesheet here, I use a kind of schema awareness for retrieving the datatype of an element in the XML, which makes it independent from the tree of elements and their names and able to display all data from the XML. The schema awareness should make it easy to adapt it to SDScom version 5, too. (Unfortunately, I have no SDS example files for version 5.)

dirk-qualisys commented 2 years ago

First of all, thank you to both of you for your work on stylesheets!

I am currently working on preparing a real life, third-party SDS in our system and will try to complete the data export (currently covering just what our customers need, not all SDS fields) over the summer. Most likely there will be some problems due to different data formats in eSDScom compared to our internal system, but the result will be publicly available end of August I think. I will post the link in this issue then.

Assuming that your approaches have different strengths, it would be great to join the advantages of both style sheetsinto one so that the workload is reduced and there is just one stylesheet (also for @geoffbrooksdev to use for his Editor). But stylesheets and the tool stack you used is beyond my technical limits, so I hope you can find a way to cooperate.

Thanks again!