Skip to main content
Known Participant
July 29, 2010
Answered

How do I combine multiple optional EDD elements

  • July 29, 2010
  • 3 replies
  • 690 views

I am trying to get a para element to allow me to type, in any order, some <TEXT>, maybe a xref, then maybe more text followed by a note, and so on.

For example I would like to write something like "For more information, see 'Hohoho' on page 27. If this cant help, nothing can. Note: if at first you dont succeed, give up". In other words I would like my Para to support <TEXT> xref <TEXT> note.

Equally I would also like to be able to write "Note: Stop and think. Now carry on and see Hohoho on page 27",ie, a Para that uses the element in the order note <TEXT> xref.

According the the Adobe FM Structure Application Developers Guide, an Ampersand means 'Child elements can occur in any order' and the Asterisk means 'Child element is optional and can occur more than once'.

So a general rule for my Para of  <TEXT> & (xref & Note)* should work, but it does not. In the structured view, I can't get past the xref element. Validation gives the following result after xref: "More contents required at end". I dont understand this as the Ampersand states any order is ok and the Asterisk states that the child element is optional. Why then does it insist on more content?

Other variations of the general rule I have tried are <TEXT> & xref* & Note*: Gives 'document is valid' but doesnt allow any more text after xref.

Also tried: (<TEXT>, xref, Note)*: Forces me to put a Note after xref even if I don't want that. And even then it returns "More contents required at end".

I am wondering if structured FM simply cannot support multiple child elements and if I should be returning to Word or OpenOffice for an unstructured solution.

Any help greatly appreciated.

This topic has been closed for replies.
Correct answer Michael_Müller-Hillebrand

1roach,

You would simply use the XML-compatible notation, which for mixed content is

( <TEXT> | Note | xref )*

I would like to draw your attention to the fact that it helps a lot to clearly distinguish between "block" elements and "inline" element. Inline elements are those next to plain <TEXT>. Block elements are the equivalent of paragraphs and other higher level organizing stuff. Although it is possible to mix them, I find structures a lot easier to maintain and to teach if there is a clear distinction.

Most people would initially think that <Note> would be a block element, assuming it might contain more than just a single sentence, maybe even a list. So be careful with the names of elements. Well-selected names help a lot in teaching a structure.

- Michael Müller-Hillebrand

3 replies

1roachAuthor
Known Participant
July 30, 2010

Michael, Van

Many thanks for your information. Michaels syntax suggestion is now working well in my EDD and after a couple of frustrating days the EDD is beginning to behave in the way I want.  Your comments about block and inline elements was very enlightening and was something that I had missed completely. True, the structure guide never used the ampersand operator in examples, something I should have picked up sooner. Anyway guys, thanks again for your very thoughtful answers.

Van Kurtz
Inspiring
July 29, 2010

1roach,

For what it is worth, I have never used the ampersand in defining the structures in my EDD. But I am guessing that there may be some logical comflict when using it with other symbols, in your case the asterisk. The ampersand MAY mean that all the child elements are required to be there but in any order. The asterisk adds optional inclusion. Hence, this may be the source of the problem...but just a guess. NOTE that the Adobe structure guide does not offer any examples using an ampersand. I prefer the rule that Michael gives.

To add to Michael's comment about block and inline elements, note that if your note element is NOT formatted as a text range, then its inclusion in your examples will result in its being put into a separate paragraph from the preceding and following text.

Van

Michael_Müller-Hillebrand
Legend
July 29, 2010

1roach,

You would simply use the XML-compatible notation, which for mixed content is

( <TEXT> | Note | xref )*

I would like to draw your attention to the fact that it helps a lot to clearly distinguish between "block" elements and "inline" element. Inline elements are those next to plain <TEXT>. Block elements are the equivalent of paragraphs and other higher level organizing stuff. Although it is possible to mix them, I find structures a lot easier to maintain and to teach if there is a clear distinction.

Most people would initially think that <Note> would be a block element, assuming it might contain more than just a single sentence, maybe even a list. So be careful with the names of elements. Well-selected names help a lot in teaching a structure.

- Michael Müller-Hillebrand