Home Forums DITA and XMetaL Discussion CSS challenge Reply To: CSS challenge

Derek Read

Reply to: CSS challenge

The products (up to and including version 6.0) do not support ~ however they do support +

So you can do this:

section > title + title:before {

That isn't going to give you exactly what you want though obviously because this means the titles must be adjacent.

You might create a series of selectors like this though:
section > title + title:before {
section > title + * + title:before {
section > title + * + * + title:before {
section > title + * + * + * + title:before {

But then you need to guess how many elements an author might put in there between title. Not the best solution I guess, unless you do already have some other strict editing guidelines that people follow.

I think in order to try to really guide your authors you have at least two options:

1) Change the DTD, or in the case of DITA specialize the DTD. In this case the standard validation rules will be enforced according to what you set up and everything else in the product will “just work”.

2) Create a script that walks the document and displays a message when these other titles are found, and maybe takes the author to the first instance and maybe even offers to delete it or all “bad” occurrences. Or the script might set CSS on these specific elements using Selection.ContainerStyle to highlight these “bad” titles in a different colour or perhaps outlines them with a border, or both.

If I can find the time, I could try to throw a script together for you. If you have any further specifics (beyond the generality that this is for XMAX 5.5) that would help. It sounds like you are in fact using the DITA DTDs with your XMAX customization.