Skip to main content
Known Participant
April 28, 2014
Question

Note element with additional paragraphs

  • April 28, 2014
  • 3 replies
  • 1375 views

FrameMaker 11.0.2.384

DITA 1.2

We need to have our <note> element so that the first or only paragraph is *not* wrapped in a <p> element. However, we want to add additional <p> elements after the first paragraph when necessary.

Here is what we want:

Here is what we get:

I have defined the following paragraph tags:

Note1Top (includes the frame above with the Note graphic and the rule)

Note1Middle (no rules and no graphic)

Note1Bot (a bottom rule and no graphic)

Note1 (use for scenarios where there are no additional paragraphs)

I have defined the <p> elements in my EDD and they are working correctly. I need to figure out how to define my <note> element in the EDD so that it uses Note1Top when they are child paragraphs or Note1TopBot when there are no child paragraphs.

Currently I have this in my <note> element in the EDD:

Else, if context is: note < (stepxmp | stepresult | info) < step

     1.1.7. If context is: {first}

                    Use paragraph format: Note1Top

               Else, if context is: {only}

                    Use paragraph format: Note1

I think the reason that the {first} and {only} sibling indicators are not working is that there are no siblings.   But what is my alternative?

Thanks in advance for any help you can provide.

Marsha

This topic has been closed for replies.

3 replies

Inspiring
April 29, 2014

Hello Marsha,

what you are trying, is to use something like an XPATH expression, like in a XSLT stylesheet.

With FM this simply doesn't work. You cannot test for child nodes in a context rule.

If you are working with raw XML files and not FM files you could define a XSLT to be used as preprocessor, that could set an attribute  which could do the trick.

But as Scott already mentioned, that is something not being exactly best practice for such a case.

It would indeed be easier to not place text directly into the note element and use a <p> element even if there's only one paragraph.

You could then test for this in the context rules for <p>, as parent/sibling rules are included in EDDs.

-Alex

Legend
April 29, 2014

Marsha,

As others have said, it is not possible to test for child paragraphs within context rules. And I agree with the sentiment about your structural setup being suboptimal. Could you explain the requirement for this setup? Perhaps somebody might have some thoughts about how to do it differently.

Russ

Known Participant
April 29, 2014

Thank you Scott, Alex, and Russ.

The requirement comes from our corporate office. Up until now, we used the <p> element even if there was only one paragraph. Corporate is saying that a <p> in a note is not acceptable. Corporate uses Arbortext Editor with DITA OT output. We use FrameMaker 11 (soon to be 12) but must still use their DITA OT output. Their DTD allows what we want to do and the output works well.

So far we've been successfully stubborn in our attempts to stay on FrameMaker rather than moving to Arbortext. (We do have access to Arbortext.) It was and is an easier transition to DITA for our writers who have been using FM for years.

Marsha

ScottPrentice
Inspiring
April 29, 2014

Hi Marsha...

I'm not sure that you can do that (I could be wrong .. and if so, someone will point that out).

But if you can, you'll need to jump through a lot of hoops .. my question to you is WHY? It's generally considered to be bad practice to use mixed content like this. Why not just use <note> with child <p> tags in all cases? (If it's because the OT renders your note/p on separate lines .. that's a bad reason to do it! That can be fixed.)

Sorry to respond to your question with another question!

...scott

Known Participant
April 28, 2014

Make that Note1 when there are not child paragraphs.

Marsha