Nested ul and ol elements

Daniel Emory danemory7224 at sbcglobal.net
Thu May 17 11:38:38 PDT 2007


--- Rick Quatro <frameexpert at truevine.net> wrote:
> I need help with text formatting rules in an EDD.
> Basically, I am allowing 
> nesting of ol and ul elements. I need rules that
> will allow a particular 
> format to be called, depending on the nesting level.
> Here is an example of 
> "flat" structure. The text in the element indicates
> the paragraph format 
> used.
> 
> <ul>
>   <li>bullet1</li>
> <ul>
> 
> <ol>
>   <li>number1</li>
> <ol>
> 
> For nested ul elements, it is no problem. In theory,
> I can do the same thing 
> with ol elements (although in practice I don't).
> 
> <ul>
>   <li>bullet1</li>
>   <ul>
>     <li>bullet2</li>
>     <ul>
>       <li>bullet3</li>
>       <ul>
>         <li>bullet4</li>
>       <ul>
>     <ul>
>   <ul>
> <ul>
> 
> What I want to be able to do is this
> 
> <ul>
>   <li>bullet1</li>
>   <ol>
>     <li>number2</li>
>     <ul>
>       <li>bullet3</li>
>       <ol>
>         <li>number4</li>
>       <ol>
>     <ul>
>   <ol>
> <ul>
> 
> or this
> 
> <ol>
>   <li>number1</li>
>   <ul>
>     <li>bullet2</li>
>     <ul>
>       <li>bullet3</li>
>       <ol>
>         <li>number4</li>
>       <ol>
>     <ul>
>   <ul>
> <ol>
> 
> or any combination of nested ol and ul elements. I
> am having trouble 
> devising the correct text formatting rules. Any help
> or pointers would be 
> appreciated. Thanks.
=============================================
Rick:
Certainly, the easiest way to deal with this is to add
attributes: A Level attribute which specifies the
indent level, a Symbols attribute which specifies a
symbol (e.g., a bullet), and a Number attribute that
specifies a number, where the default value for the
symbol and number attributes should be "None". So, if
both the Symbol and Number attributes are set to None,
there is no number or symbols prefix. But, if either
of these attributes is set to a non-None value, that
value whall become the prefix). 

Regardless of the level, specify an element paragraph
format which does not specify either the indent level
of the number or bullet type. Below, I describe the
prefix and format rules

Prefix Rules for the OL or UL element (same set of
prefix rules for both elements)

1  If context is: [Number != "Off"]
    <attribute Number>.
   Else if [Symbol != "Off"]
    <attribute Symbol]
Note: If a number is specified, the prefix rule ends
with a period, followed by an empty space. If a symbol
is specified, the prefix rule ends with an empty
space.

Context Rules for the OL and UL element (same set of
rules and format change lists for both the Ol and Ul
elements

1. This rule specifies the indent level
If context is: Level = "1"]  
    Use format change list: Level1
Else, if context is [Level = "2"]
   Use format change list: Level2

and so on and so on for each possible indent value.

Each specified format change list modifies the base
element's paragraph format by specifying the amount of
indent which precedes the text produced by the prefix
rule.

The space specified at the end of the prefix rule
separates the number of symbol from the text that follows.



More information about the framers mailing list