Home › Forums › DITA and XMetaL Discussion › Processing instructions not displayed › Reply To: Processing instructions not displayed
Reply to: Processing instructions not displayed
November 9, 2011 at 11:37 pmProcessing instructions are meant to be hidden by default for DITA documents (by design), but the person that wrote the CSS got it wrong. However, because the effect is ultimately what our UI designer called for (she may have written the CSS as well) it looks like it passed through our QA without question.
In the CSS files we ship for DITA authoring there are two selectors that come into play for your “codex” PI.
The first one sets color and font styling, but then the second one overrides all of that by hiding all PIs.
[code]$PROCINS {
background-color: #F0F8FF;
color: #000066;
text-align: left;
font-style: italic;
}
$PROCINS[Pub], $PROCINS[Interwoven], $PROCINS[iw_document], $PROCINS[interwoven], $PROCINS[iw_component] {
display: none;
}[/code]
Why?
The format is incorrect in the second one (as you seem to have guessed) and so the portion inside the square brackets is being ignored (looks like somebody here needs to be updated on how this feature works — I'll follow up on that) and treats it as if only “$PROCINS” was specified.
What it should be is this:
[code]$PROCINS {
display: none;
}
[/code]
Then when you add your (proper) selector only your special “codex” PIs will show up because your selector is more specific:
[code]
$PROCINS[xm-pi-target=”codex”] {
display: inline;
}
[/code]
In your case I would replace the two existing selectors either with the one immediately above by itself, or with the following if you still wish other PIs to be invisible:
[code]$PROCINS {
display: none;
}
$PROCINS[xm-pi-target=”codex”] {
display: inline;
}[/code]
It sort of depends how your users are entering the PIs I suppose. I could see a case where they enter “cod” (without the “ex”) get distracted and switch views, thereby causing the document to be reformatted so that their “cod” PI would be invisible (making it hard to fix or remove). Not a big deal perhaps but you could end up with some junk PIs in the doc. Likewise, even if you use an API to insert them in their entirety an author might still delete a character or modify one.
Note that there are other PIs in the DITA CSS files but they should not come into play given what you are trying to do as your PI should have the most specific selector.
See my posting here for more detail on this CSS-extention for PIs (all of the $SOME_NAME selectors are our own invention, not part of the CSS recommendation). I don't think the PI ones have been properly documented in our help for XMetaL Developer since the feature was updated to allow for specifying target and/or data values.
http://forums.xmetal.com/index.php/topic,24.0.html