Skip to main content
Inspiring
October 27, 2021
Answered

How do I handle nested bullets with a conversion table?

  • October 27, 2021
  • 2 replies
  • 262 views

How do I preserve the hierarchy of nested bullets in the unstructured file in the converted structured file?

I set it up this way

P: Bulleted Level 1        li      L1

P: Bulleted Level 2        li      L2

 

which yields li[L1] and li[L2]

 

I then wrap the entire list with this top level element:

E:li[b]+&E:li[b2]+       ul

 

which yields this:

<ul>

    <li>blah</li>

     <li>blab</li>

     <li>blab</li>

</ul>

 

but I can't figure out how to get this, i.e, how do I demote the "blab" list items?

<ul>

   <li>blah<ul>

        <li>blab</li>

        <li>blab</li>

        </ul>

   </li>

</ul>

Any help would be greatly appreciated.

 

    This topic has been closed for replies.
    Correct answer Russ Ward

    Hi, I think you need one more rule, and then reference the results from that rule in the last rule you showed. Your first set looks fine:

     

    P: Bulleted Level 1     li     L1

    P: Bulleted Level 2     li     L2

     

    ...then you need a new rule to wrap the level-2 sublists, which I think should look something like this:

     

    E:li[L2]+, (E:li[L2])*     ul     UL2

     

    ...then you can wrap up the first-level list items along with sublists with a rule like this, which is a modification to the last rule you showed:

     

    E:li[L1]+, (E:li[L1] | E:ul[UL2])*     ul     UL1

     

    ...and then I presume you would continue wrapping up the E:ul[UL1] and other body-content elements in some section-type elements, using the same concept.

     

    I hope this helps.

    Russ

     

    2 replies

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    October 27, 2021

    Here is how I do it. Keep in mind that formatting differences may affect your inclusion in Sections.

     

    David Creamer: Community Expert (ACI and ACE 1995-2023)
    Russ WardCorrect answer
    Legend
    October 27, 2021

    Hi, I think you need one more rule, and then reference the results from that rule in the last rule you showed. Your first set looks fine:

     

    P: Bulleted Level 1     li     L1

    P: Bulleted Level 2     li     L2

     

    ...then you need a new rule to wrap the level-2 sublists, which I think should look something like this:

     

    E:li[L2]+, (E:li[L2])*     ul     UL2

     

    ...then you can wrap up the first-level list items along with sublists with a rule like this, which is a modification to the last rule you showed:

     

    E:li[L1]+, (E:li[L1] | E:ul[UL2])*     ul     UL1

     

    ...and then I presume you would continue wrapping up the E:ul[UL1] and other body-content elements in some section-type elements, using the same concept.

     

    I hope this helps.

    Russ