Pages: 1
Print
Author Topic: Processing instructions not displayed  (Read 3335 times)
paul_cpwr
Member

Posts: 17


« on: November 09, 2011, 04:54:10 PM »

As a solution to another question (see http://forums.xmetal.com/index.php/topic,1747.0.html) I'm altering a script to insert a processing instruction instead of a troublesome Unicode character. The problem is that I can't get the processing instruction (truthfully, _any_ PI) to stay visible in any DITA document. If I insert a processing instruction (from the command on the main menu), it appears and accepts my input. As soon as I change views, the PI disappears and is never visible unless I switch to text-only mode.

I've searched through the CSS files for my specialized DITA application and the default DITA CSS files that came with XMetaL and I can't find anything that would make this happen. I've tested this behavior in my specialized DITA DTDs and also in the default DITA DTDs that come with XMetaL; the behavior is the same.

Here's a sample workflow:
1. Create a new DITA concept.
2. Insert some text in a p element.
3. Within that same p element, select Insert > Advanced > Processing Instruction. A blank processing instruction appears.
4. Enter your processing instruction data, for example "codex zwsp" (without the quotes). The PI appears valid.
5. Toggle views (between tags on/off or vice versa). The PI disappears and never comes back.
6. Switch to Text Only view. The PI is still there but insists on being invisible.

If I perform the same workflow with a Article (from the Jouralist DTD), the PI stays visible in all views.

Also, the documentation shows one method for styling PIs but I see another method being used in the CSS files that come with the default DITA application.

To style all PIs with a "codex" target, the doc says to use the following selector:
$procins[xm-pi-target="codex"]

In the $XM_HOME/Author/DITA/XACs/shared/ditabase-base.css, I see selectors like:
$PROCINS[Pub]

Which is the proper method?

Background: I'm using XMetaL 6.0.2.070 with the latest DITA 1.2 kit installed, running on Windows XP.

Any assistance is appreciated.

Best regards,

Paul Anderson
Information Developer, Compuware Corporation
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: November 09, 2011, 05:37:37 PM »

Processing 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;
}

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;
}

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;
}

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;
}

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


« Last Edit: November 09, 2011, 05:48:13 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: November 09, 2011, 06:57:14 PM »

My mistake. Looks like we do have up-to-date information in the Customization Guide.
Logged
paul_cpwr
Member

Posts: 17


« Reply #3 on: November 16, 2011, 01:02:27 PM »

You were correct. Altering my CSS selection for my PI to explicitely set display back to "inline" did the trick.

Best regards,

Paul
Logged
Pages: 1
Print
Jump to:  

email us