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

ISO: Do diff with ISO Word CSS #20

Open
ronaldtse opened this issue Nov 26, 2019 · 6 comments
Open

ISO: Do diff with ISO Word CSS #20

ronaldtse opened this issue Nov 26, 2019 · 6 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@ronaldtse
Copy link
Contributor

(This ticket is not ready to be acted on)

@opoudjis will be providing instructions to retrieve ISO Word CSS so that the PDF output can be 100% matching.

We will also need to do a visual diff between the two types of output.

@opoudjis
Copy link
Contributor

opoudjis commented Dec 3, 2019

Visual diff. Oh dear.

Pls find attached CSS for the Word documents for ISO. They are cleaned up, and the corresponding Metanorma tags are given in comments after each style command.

Αρχειοθήκη.zip

@opoudjis opoudjis assigned Intelligent2013 and unassigned opoudjis Dec 3, 2019
@ronaldtse
Copy link
Contributor Author

For now I think the solution is this. We can have XSL-FO extract common values from CSS (e.g. some representation of CSS, YAML, XML, whatever).

https://stackoverflow.com/questions/17495152/using-external-css-in-xsl-fo/17548638

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Dec 5, 2019

@ronaldtse
We can't use CSS for 100% matching between Word and PDF.
The reasons:

  • CSS contains msoffice specific styles like mso-padding-alt, mso-layout-grid-align, mso-border-alt, mso-level-number-format, mso-para-margin.
  • CSS contains some styles, which don't have analog in xsl-fo. For example: tab-stops. To emulate it in XSL-FO, it's necessary to use specific constructions.

When I've wrote xslt, sure, I've used the properties from CSS to maximal matching.
Regarding using of <xsl:attribute-set name=..., I think it's a good idea for define styles in a separate xslt.
But, on my opinion, is's good for small xslt, and it is more complex for maintenance of big code, because in case of change some style we need:

  1. find element for which we want change style
  2. goto to <xsl:attribute-set section and change style
  3. check another element which uses these attribute sets to prevent undesirable changes.

In case of 'inline' style (as made) we only make change in local place of code.

@ronaldtse
Copy link
Contributor Author

@Intelligent2013 are there any parameters that the CSS and XSL-FO stylesheets can share? The synchronization of both for a single type of document can be difficult without that.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Dec 5, 2019

@ronaldtse

@Intelligent2013 are there any parameters that the CSS and XSL-FO stylesheets can share? The synchronization of both for a single type of document can be difficult without that.

Yes - for example. font-family, font-size, font-style, font-weight, margin-*, text-align, text-decoration. They have identical behaviour.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Dec 5, 2019

But it's not prevent for such case, when paragraph uses CSS class zzContents and redefine property 'margin-top':

<p class="zzContents"  style="margin-top:0cm"  >
  <span lang="EN-GB" xml:lang="EN-GB">Contents</span>
</p>

p.zzContents, li.zzContents, div.zzContents {
mso-style-name: zzContents;
mso-style-noshow: yes;
mso-style-unhide: no;
mso-style-next: "TOC 1";
margin-top: 48.0pt;
margin-right: 0cm;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants