Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • XSweet XSweet
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 52
    • Issues 52
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • XSweetXSweet
  • XSweetXSweet
  • Issues
  • #106
Closed
Open
Issue created Jun 12, 2017 by Alex Theg@athegOwner

Handle lists

Let’s see what we can do with lists!

In Word, there’s no tag that wraps an entire list. Lists are implemented as a sequence of consecutive <p> tags of style “ListParagraph”:

<w:p w14:paraId="5D2E8ABB" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
     <w:pPr><w:pStyle w:val="ListParagraph"/>
         <w:numPr><w:ilvl w:val="0"/><w:numId w:val="1"/></w:numPr>
     </w:pPr>
     <w:r>
         <w:t>seven</w:t>
     </w:r>
</w:p>

To me, here's what makes sense to me to handle lists:

  1. look for paragraphs with “ListParagraph” style in the <w:pPr> (so this would have to happen before this info gets thrown away)
  2. once you find one, keep checking subsequent paragraphs until it finds a p without the “ListParagraph” style
  3. wrap all the consecutive ListParagraph items in a list tag

In the <w:numPr> tag, there are definitely one and maybe two attributes that we’d care about: ilvl and numId.

ilvl indicates whether and how the list item is nested below other items or top-level. Top level items have an ilvl of 0, a sub-list item has an ilvl of 1, a list item nested under that would have a ilvl of 2, etc:

  • Top level list item // ilvl=0
    • Nested list item // ilvl=1

These define the structure of the list, and should ideally be reflected in the html.

The numId attribute refers to the numbering schema for any given list, contained in the numbering.xml file. Each time a list is made, its style info is added to the “numbering.xml” file under the same numId reference. That means there’s no indication of how a list is styled in the document.xml itself. To get the list style info (numbered, bulleted, undecorated, etc.), XSweet would have to follow the reference into the numbering.xml file. Is that possible, or too hard to do?

  • If it is possible, the html more faithfully reflect the Word doc, and Typescript could port list into Editoria as the correct type (numbered, unnumbered, or bulleted).
  • If it’s too difficult to start with this, though, then numId could probably just be dropped.

It seems like this should be its own xsl sheet, early in the pipeline. Really curious to hear what you think!

Here’s a test Word doc, along with the xml. list_test.docx

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document
    xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
    xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mv="urn:schemas-microsoft-com:mac:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
    xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
    xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
    xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
    xmlns:w10="urn:schemas-microsoft-com:office:word"
    xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
    xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
    xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml"
    xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
    xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
    xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
    xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
    mc:Ignorable="w14 w15 wp14">
    <w:body>
        <w:p w14:paraId="3BB77D17" w14:textId="77777777" w:rsidR="00B82E58" w:rsidRDefault="00D02C23">
            <w:r w:rsidRPr="00D02C23">
                <w:t>Although states and other interested parties sponsor and partially control the content of religious messages, individuals do react variously to those messages. Viewers interpret and appropriate words and images in particular ways, and according
                    to their own situations, since shared television reception is also an individualized experience.</w:t>
            </w:r>
        </w:p><w:p w14:paraId="7E7F6913" w14:textId="77777777" w:rsidR="00260CBA" w:rsidRDefault="00260CBA" w:rsidP="007D2792"/>
        <w:p w14:paraId="77D8D9E3" w14:textId="0BC2F129" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="007D2792">
            <w:r>
                <w:t>Here are some example lists</w:t>
            </w:r>
            <w:r w:rsidR="00DB59FD">
                <w:t>:</w:t>
            </w:r>
        </w:p><w:p w14:paraId="552BC6C9" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23"/>
        <w:p w14:paraId="0B75E776" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="007D2792">
            <w:r>
                <w:t>Bulleted list</w:t>
            </w:r>
        </w:p>


        <!-- bullet -->
        <w:p w14:paraId="5D2E8ABB" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="1"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>seven</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="5D8D1F85" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="1"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>fourteen</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="09FF0743" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="1"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>three</w:t>
            </w:r>
        </w:p><w:p w14:paraId="17C655EE" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23"/>


        <!-- mulitlevel bullet -->
        <w:p w14:paraId="2EDB54F8" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="007D2792">
            <w:r>
                <w:t>Multilevel</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="2F5768D7" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="2"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Point A</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="475DC32B" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="2"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Point B</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="731511E6" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="1"/><w:numId w:val="2"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Point B.1</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="0A5C9720" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="1"/><w:numId w:val="2"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Point B.2</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="1D1E4FC3" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="2"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Point C</w:t>
            </w:r>
        </w:p><w:p w14:paraId="2EE6BAF7" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23"/>


        <!-- numbered -->
        <w:p w14:paraId="649F6860" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="007D2792">
            <w:r>
                <w:t>Numbered list</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="49E83B01" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="3"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Stop</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="6D2C65FC" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="3"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Drop</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="5B515F78" w14:textId="77777777" w:rsidR="00D02C23" w:rsidRDefault="00D02C23" w:rsidP="00D02C23">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="3"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Roll</w:t>
            </w:r>
        </w:p><w:p w14:paraId="3AD4CE3C" w14:textId="77777777" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3"/>


        <!-- multilevel numbered -->
        <w:p w14:paraId="581E2232" w14:textId="4791D278" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:r>
                <w:t xml:space="preserve">Multilevel numbered
                </w:t>
            </w:r>
            <w:r>
                <w:t>list</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="4450BE7A" w14:textId="77777777" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="4"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Stop</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="68A823BD" w14:textId="77777777" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="4"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Drop</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="482394C4" w14:textId="2CE4A683" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="1"/><w:numId w:val="4"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>To the ground</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="3367B702" w14:textId="250D58D1" w:rsidR="003808A3" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="1"/><w:numId w:val="4"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Or the ceiling</w:t>
            </w:r>
        </w:p>
        <w:p w14:paraId="0685DA8E" w14:textId="7F5507ED" w:rsidR="003808A3" w:rsidRPr="00D02C23" w:rsidRDefault="003808A3" w:rsidP="003808A3">
            <w:pPr><w:pStyle w:val="ListParagraph"/>
                <w:numPr><w:ilvl w:val="0"/><w:numId w:val="4"/></w:numPr>
            </w:pPr>
            <w:r>
                <w:t>Roll</w:t>
            </w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p>
        <w:sectPr w:rsidR="003808A3" w:rsidRPr="00D02C23" w:rsidSect="00227C1D"><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/><w:docGrid w:linePitch="360"/></w:sectPr>
    </w:body>
</w:document>
Assignee
Assign to
Time tracking