writing rules for descendants in EDD

Lynne A. Price lprice at txstruct.com
Fri Aug 1 09:40:18 PDT 2008


Cindy,
   Roger is correct that FM context rules cannot query descendants 
(otherwise, every change you make to a document's element structure could 
potentially trigger reformatting the entire document, and editing 
performance would be unacceptably slow).  You may be able to get the 
desired formatting by:

1) Setting the indentation for p within a QandA sec to 1.5pc (regardless of 
whether the p contains a bold)

2) Defining bold at the start of a p within a QandA set to be a paragraph 
with indentation of 0 and making this paragraph a run-in head.

   Alternatively, you could change the structure (either in the original 
XML or using XSLT to change it only within FrameMaker) to reflect the 
logical structure that motivates the formatting, something like:

<QandA>
    <Question>
       <p>text of question</p>
       <p>continued text of question</p>
    </Question>
    <Answer>
       <p>text of answer</p>
       <p>continued text of answer</p>
    </Answer>
</QandA>

Note that I have not bothered to include the labels "Question:" and 
"Answer:" in this modified XML since they can be generated as prefixes on 
the first p in a Question or Answer. If these labels may vary, of course, 
they should be retained in the modified document. It would be 
straightforward to derive this structure from the original in XSLT. Since 
XSLT applies to a static document, the performance considerations that 
motivated the design of FrameMaker's context specifications are not 
relevant, and XSLT can test descendants as well as ancestors of an element.

         --Lynne


At 01:20 PM 7/23/2008, Cindy Maisannes wrote:
>Hi Roger,
>
>Thanks for your response.  The XML files that I am pulling into FrameMaker 
>have a structure like this:
>
><sec sec-type="QandA">
><p><bold>Question:</bold> text of question</p>
><p><bold>Response:</bold> text of response</p>
></sec>
>
>However, sometimes the text of a question or a response lasts into a 
>second or third paragraph, such as this:
>
><sec sec-type="QandA">
><p><bold>Question:</bold> text of question</p>
><p> continued text of question </p>
><p><bold>Answer:</bold> text of answer</p>
><p> continued text of answer </p>
></sec>
>
>and I would like to be able to say that all paragraphs inside a <sec 
>sec-type="QandA"> that do not have a <bold> descendant are indented 1.5pc, 
>for example.  Other paragraphs with a <bold> descendant inside a <sec 
>sec-type="QandA"> should not be indented.  I can't figure out how to do this.
>
>Thanks again,
>Cindy
>
>
>-----Original Message-----
>From: Shuttleworth, Roger [mailto:Roger_Shuttleworth at tvworks.com]
>Sent: Wednesday, July 23, 2008 4:00 PM
>To: Cindy Maisannes
>Subject: RE: writing rules for descendants in EDD
>
>Hi Cindy
>
>I don't believe you can do this. The syntax handles ancestors and siblings 
>but not descendants. Offhand, I can't think of a way to accomplish this
>without using different elements for those that contain a <bold> element.
>
>But perhaps it would help if you give an example of your desired output. 
>I'm having a hard time imagining why you would want to do this.
>
>Regards,
>
>Roger Shuttleworth
>London, Canada
>
>_______________________________________________
>
>
>You are currently subscribed to Framers as lprice at txstruct.com.
>
>Send list messages to framers at lists.frameusers.com.
>
>To unsubscribe send a blank email to
>framers-unsubscribe at lists.frameusers.com
>or visit 
>http://lists.frameusers.com/mailman/options/framers/lprice%40txstruct.com
>
>Send administrative questions to listadmin at frameusers.com. Visit
>http://www.frameusers.com/ for more resources and info.


Lynne A. Price
Text Structure Consulting, Inc.
Specializing in structured FrameMaker consulting, application development, 
and training
lprice at txstruct.com            http://www.txstruct.com
voice/fax: (510) 583-1505      cell phone: (510) 421-2284 





More information about the framers mailing list