IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

external CSS issue Options · View
micky
Posted: Thursday, February 9, 2017 12:16:50 PM
Rank: Advanced Member

Joined: 3/8/2011
Posts: 45
Hello,
I'm using Stylevision 20014 and I have following issue.
In my my stylesheet I'm using external CSS file, which is long but contains
Code:

.flex {
    /* basic styling */
    width: 100%;
    height: 100%;
    border: none;
    flex-wrap: nowrap;
    /* flexbox setup */
    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */
    -webkit-flex-direction: row;
    flex-direction: row;
}


Stylevision is complaining with :
'Warning - Parsing error ... unexpected token -webkit-box'
and none of the formatting is applied in design mode.
When I generate HTML everything is formatted as it should be and report is ok.
When I generate PDF however none of the formatting is applied.

Actually the problem is in all 'display' properties, but they are intended only for HTML (browsers).
Why PDF is not rendered properly? Or maybe if Stylevision says that CSS is 'no good' and entire file is ignored.

Has anybody encountered this issue?
K101
Posted: Thursday, February 9, 2017 1:00:39 PM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
This is because StyleVision has to read in your CSS and re-formulate it as XSL:FO style properties for PDF output. Raw CSS in and of itself means nothing in an XSL:FO context. If StyleVision encounters some "invalid" CSS it abandons parsing the whole file for this purpose. The only thing it does then is passes it on to generated HTML via a CSS @import rule, so the raw CSS still "works."

You should separate your CSS into two files and add both to your design, one which contains standard CSS which doesn't show any errors on being included in your design, and another for your special vendor-specific display styles which only mean something in a browser.
micky
Posted: Thursday, February 9, 2017 1:35:27 PM
Rank: Advanced Member

Joined: 3/8/2011
Posts: 45
I've tested with two separate CSS files and it works as expected. Both HTML & PDF are properly formatted.

Thank you
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.