Wiki

Clone wiki

Okapi / ResourceCase004

List embedded inside a paragraph

In this case an HTML pargaraph contains an embedded list, with text before and after.

<p>Text before list:
 <ul>
  <li>Text of item 1</li>
  <li>Text of item 2</li>
 </u>
 and text after the list.</p>

TextUnit model

Event -> Resource (with GenericSkeleton):

Note that here the <li> tags are treated as groups as they may contain several <p> elements. Maybe it would be better to generate only a TextUnit when <li> has no <p> but just text content.

START_GROUP -> StartGroup={
   id=g1
   properties={
   }
   isReference=true
   skeleton={
      part='<ul>'
   }
}
START_GROUP -> StartGroup={
   id=g2
   properties={
   }
   isReference=false
   skeleton={
      part='\n  <li>'
   }
}
TEXT_UNIT -> TextUnit={
   id=t1
   properties={
   }
   isReference=false
   text=[Text of item 1]
   skeleton={
   }
}
END_GROUP -> Ending={
   id=g2
   skeleton={
      part='</li>'
   }
}
START_GROUP -> StartGroup={
   id=g3
   properties={
   }
   isReference=false
   skeleton={
      part='\n  <li>'
   }
}
TEXT_UNIT -> TextUnit={
   id=t2
   properties={
   }
   isReference=false
   text=[Text of item 2]
   skeleton={
   }
}
END_GROUP -> Ending={
   id=g3
   skeleton={
      part='</li>'
   }
}
END_GROUP -> Ending={
   id=g1
   skeleton={
      part='\n </ul>'
   }
}
TEXT_UNIT -> TextUnit={
   id=t3
   properties={
   }
   isReference=false
   text=[Text before list: \n {#$g1}\n and text after the list.]
   skeleton={
      part='<p>'
      part='{#$$self$}'
      part='</p>'
   }
}

Maximalist TextFlow model

<p>Text before list:
 <ul>
  <li>Text of item 1</li>
  <li>Text of item 2</li>
 </u>
 and text after the list.</p>

becomes

TextFlow[id=1]{ // p
  Properties{}
  Content{
    TextFragment[id=2]{'Text before list:\n  '}
    ResourceFragment[id=3]{ // ul
      ref:Container[ref-id=4]
    }
    TextFragment[id=9]{'\n and text after the list'}
  }
}

Container[id=4]{ // ul
  Properties{}
  Children{
    ref:TextFlow[ref-id=5]
    ref:TextFlow[ref-id=7]
  }
}

TextFlow[id=5]{ // li
  Properties{}
  Content{
    TextFragment[id=6]{'Text of item1'}
  }
}

TextFlow[id=7]{ // li
  Properties{}
  Content{
    TextFragment[id=8]{'Text of item2'}
  }
}

Updated