Pages: 1
Print
Author Topic: CSS for XMetaL XACs, foreign languages  (Read 2362 times)
pmasal
Member

Posts: 85


« on: April 09, 2013, 09:43:43 AM »

Our XAC CSS files are working well for en-US authors in XMetaL, automatically showing strings like "Note," "Caution," etc. according to the DITA <note type=""> 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) :-)
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2579



WWW
« Reply #1 on: April 09, 2013, 05:33:51 PM »

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(..\..\shared\ditabase-base.css);
@import url(..\ditabase\ditabase-base-override.css);
@import url(..\..\shared\ditabase-derived.css);
@import url(..\ditabase\ditabase-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.
« Last Edit: April 09, 2013, 05:42:56 PM by Derek Read » Logged
pmasal
Member

Posts: 85


« Reply #2 on: April 10, 2013, 11:47:58 AM »

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
Logged
pooh2583
Member

Posts: 47


« Reply #3 on: October 24, 2013, 03:55:55 AM »

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
<!ELEMENT para (top, middle , bottom) > and suppose i have to insert element bottom and my current insertion point is  between top and middle i.e.
<para>
<top>test1</top>
(this is my current range)
<middle></middle>.
<para>
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

Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2579



WWW
« Reply #4 on: October 24, 2013, 01:57:53 PM »

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.
Logged
Pages: 1
Print
Jump to:  

email us