DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion CSS for XMetaL XACs, foreign languages

  • pmasal

    CSS for XMetaL XACs, foreign languages

    Participants 3
    Replies 4
    Last Activity 9 years, 5 months ago

    Our XAC CSS files are working well for en-US authors in XMetaL, automatically showing strings like “Note,” “Caution,” etc. according to the DITA attribute. Same for tables, figures, etc.

    However, we have authors working in foreign languages, such as de-DE and es-ES. They see en-US note classifications, because I can't seem to customize the CSS files to deliver specific content based on the value of xml:lang.

    Can anyone offer advice on how to do this? Many thanks!
    Paul Masalsky
    Very Large Company in Seattle (not allowed to say the name) 🙂

    Reply

    Derek Read

    Reply to: CSS for XMetaL XACs, foreign languages

    The CSS files are loaded by the main CSS file for each topic type (located in the XACs subfolder named corresponding to the topic type) in this order:

    @import url(....sharedditabase-base.css);
    @import url(..ditabaseditabase-base-override.css);
    @import url(....sharedditabase-derived.css);
    @import url(..ditabaseditabase-derived-override.css);
    @import url(topic_ditabase-specialized.css);

    You need to do two things:
    1) Make sure whatever selector you add is loaded after any that you are trying to override.
    2) Make sure your selector is at least as specific.

    Most of the selectors we use for DITA use the @class attribute in order to automatically support specialization (specialized elements look like their unspecialized version automatically as their share a portion of their @class value). So you generally need to use the @class attribute when making overrides. I think you need something like this:

    /* note[type=(default-value)]:before {*/
    [class~="topic/note"][xml|lang="de"]:before {
    content: "German Translation for Note Goes Here: ";
    }

    Note the specific character that CSS requires you to substitute for a colon. This normally only comes up for XML Schema that use namespaces, but colon is a valid character for DTDs as well and must also be used in this instance.

    Reply

    pmasal

    Reply to: CSS for XMetaL XACs, foreign languages

    This suggestion was really close and led me to the right syntax, which is:

    [xml|lang |= 'de'][class~=”topic/note”]:before {
    content: “Anmerkung: “;
    font-weight: bold;
    display: inline; }

    Thanks as always, Derek!
    Paul

    Reply

    pooh2583

    Reply to: CSS for XMetaL XACs, foreign languages

    Hello,

    Above solution is working if and only if the element can be inserted into the current insertion point , i.e
    If my DTD has structure
    and suppose i have to insert element bottom and my current insertion point is  between top and middle i.e.test1
    (this is my current range)
    .
    then according to canInsert api it throws false because as per the DTD bottom element can not be inserted at the current location
    but my requirement is I have to check in entire para element whether  element bottom can
    be inserted or not and if DTD allows bottom element to be inserted into para it should move to the
    valid insertion point into para and insert there into the para element.

    Could you please help me in determining how shall I go with it, finding whether particulr element can be inserted anywhere into the selected current node that element or not instead of that particular location

    Reply

    Derek Read

    Reply to: CSS for XMetaL XACs, foreign languages

    The original topic here was about DITA documents and modifying the CSS files that we include with the DITA authoring customization to meet the needs of the OP. I'm not sure your question makes sense in this context.

    Are you writing a macro to insert something?
    If so, I think you should start a new topic, and if it is not related to DITA then please also post it on the “General XMetaL Discussion” board.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support