none
Numbering properties application hierarchy RRS feed

  • Question

  • Hello,

    I have a hard time understanding why in a file that has the following properties defined for a paragraph, the indentation is 1" (1440tw) instead of 2" (2880tw).

    The paragraph has:

    <w:p>
          <w:pPr>
            <w:pStyle w:val="StandardAufzhlungStrich" />
            <w:numPr>
              <w:ilvl w:val="0" />
              <w:numId w:val="35" />
            </w:numPr>
            <w:tabs>
              <w:tab w:val="clear" w:pos="284" />
              <w:tab w:val="left" w:pos="708" />
            </w:tabs>
            <w:ind w:left="1440" />
            <w:rPr>...</>
          </w:pPr>
          <w:r>...</>
        </w:p>

    It refers in its direct formatting to numbering instance 35:

      <w:num w:numId="35">
        <w:abstractNumId w:val="69" />
      </w:num>
    

    which in turn refers to abstractNum 69:

      <w:abstractNum w:abstractNumId="69" w15:restartNumberingAfterBreak="0">
        <w:nsid w:val="72240C9E" />
        <w:multiLevelType w:val="hybridMultilevel" />
        <w:tmpl w:val="8C180636" />
        <w:lvl w:ilvl="0" w:tplc="47085AA2">
          <w:start w:val="1" />
          <w:numFmt w:val="bullet" />
          <w:pStyle w:val="StandardAufzhlungStrich" />
          <w:lvlText w:val="" />
          <w:lvlJc w:val="left" />
          <w:pPr>
            <w:tabs>
              <w:tab w:val="num" w:pos="1260" />
            </w:tabs>
            <w:ind w:left="2880" w:hanging="720" />
          </w:pPr>
          <w:rPr>
            <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default" />
          </w:rPr>
        </w:lvl>
    ...
    </w:abstractNum>

    OOXML Part 1, §17.7.2 says, 

    Finally, we apply direct formatting (paragraph or run properties not from styles). If this direct formatting

    includes numbering, that numbering + the associated paragraph properties are applied.

    MS-OI29500 §2.1.229 corrects OOXML Part 1, §17.7.2 to

    Word applies paragraph styles before numbering styles in the style hierarchy. 

    which in the case of the direct formatting clause we're dealing in my example is not even relevant, as this sequence of application is already correct in the sentence in the original OOXML spec. So the application hierarchy for the <w:ind> property in the above case is:

     (a) <w:ind w:left="1440" /> from direct paragraph formatting, overridden by

    (b) <w:ind w:left="2880" w:hanging="720" /> from the direct numbering formatting

    To my reading and understanding of all relevant passages of the multiple specs, this should result in an indent of the paragraph text by 2280tw. However, Word renders it at an indent of 1440tw.

    Why is this? Is this an error in the spec, Word implementation or my understanding?

    Thanks, Christian

    Saturday, July 4, 2020 10:02 AM

All replies

  • Christian,

    Thank you for your question.  An engineer from the protocols team will contact you soon.


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team

    Saturday, July 4, 2020 8:28 PM
    Moderator
  • Hi Christian, 

    Thanks for the question, I will assist you with this and will follow up soon with more information. If you have a sample document that you are basing your question on and can provide this, please do. 

    Best regards, 
    Tom Jebo
    Microsoft Open Specifications Support


    Sunday, July 5, 2020 3:13 PM
    Moderator
  • Hi Tom,

    I'd have included the sample document already in my original question if there was a way to attach a file to a post.

    I checked the Forum FAQ, but haven't found any mentioning of attachments or how to supply files for testing. So, how would I provide that sample file to you?

    Thanks, Christian

    Monday, July 6, 2020 7:08 AM
  • Sorry, I thought maybe you had sent to us before. You can send to dochelp at Microsoft dot com. Just mention the URL for this thread and my name in the email. 

    I like to have the whole document because sometimes there are other factors playing that come from other parts. 

    Thanks,

    Tom

    Monday, July 6, 2020 7:20 AM
    Moderator
  • kriro, 

    Thanks for the file, I checked it out and it looks like maybe you're right. I have some more testing to do to confirm. 

    I did create a very simple version of this as well, basically a blank document with the following in \word\document.xml: 

          <w:pPr>
            <w:pStyle w:val="ListParagraph"/>
            <w:numPr>
              <w:ilvl w:val="0"/>
              <w:numId w:val="2"/>
            </w:numPr>
            <w:ind w:left="2880"/>
          </w:pPr>
          <w:r>
            <w:t>TEST</w:t>
          </w:r>
        </w:p>

    and the following in \word\numbering.xml:

      <w:num w:numId="2">
        <w:abstractNumId w:val="0"/>
      </w:num>

    ...

    <w:abstractNum w:abstractNumId="0" w15:restartNumberingAfterBreak="0"> <w:nsid w:val="30BC6356"/> <w:multiLevelType w:val="hybridMultilevel"/> <w:tmpl w:val="52F63072"/> <w:lvl w:ilvl="0" w:tplc="0409000F"> <w:start w:val="1"/> <w:numFmt w:val="decimal"/> <w:lvlText w:val="%1."/> <w:lvlJc w:val="left"/> <w:pPr> <w:ind w:left="720" w:hanging="360"/> </w:pPr> </w:lvl>


    and the following in \word\styles.xml:

      <w:style w:type="paragraph" w:styleId="ListParagraph">
        <w:name w:val="List Paragraph"/>
        <w:basedOn w:val="Normal"/>
        <w:uiPriority w:val="34"/>
        <w:qFormat/>
        <w:rsid w:val="002437FC"/>
        <w:pPr>
          <w:ind w:left="720"/>
          <w:contextualSpacing/>
        </w:pPr>
      </w:style>
    

    And I see the same behavior that the direct 2880 twips gets used. Have you tested this on any other versions of Word and did this just start in 2016 with a recent update?

    Tom

    Tuesday, July 7, 2020 7:08 PM
    Moderator
  • Hi Tom,

    thanks for your reply!

    I'm seeing this in Word for Mac 16.16.19 and Word 2013 for Windows 15.0.5172.1000 - the only two versions I have at hand.

    This is not a change/regression report, but merely a question of my understanding and implementing the multitude of aspects of the specs such that my implementation is corrrect and hence interoperable with Word as my customers use it.

    So my question really is: Is my understanding of the specs correct (and Word is implementing them wrongly), or is my understanding of the specs incorrect (and how should I read them correctly instead), or are the specs themselves incorrect?

    Thanks,
    Christian


    • Edited by kriro Wednesday, July 8, 2020 12:51 PM
    Wednesday, July 8, 2020 12:50 PM
  • kriro,

    The note in [MS-OI29500] 2.1.229 refers to the first five bullets in ISO 29500-1 17.7.2. The final bullet is dealing with direct formatting but if there are styles invoked in that direct formatting they follow the first five bullets (taking into account [MS-OI29500]. 

    So in my example above, which I believe is a good representation of your problem scenario, we have direct formatting of this: 

          <w:pPr>
            <w:pStyle w:val="ListParagraph"/>
            <w:numPr>
              <w:ilvl w:val="0"/>
              <w:numId w:val="2"/>
            </w:numPr>
            <w:ind w:left="2880"/>
          </w:pPr>

    The <w:pStyle> and <w:numPr> elements refer to styles. These two elements and their contents must compete as styles/numbering according to the first five bullets in the hierarchy in 17.7.2. As a result these are processed first.

    The last element: 

    <w:ind w:left="2880">

    Is not referring to a style part but itself direct formatting. It therefore is applied last and does not have an order wrt to style parts. You can test this by changing the values in each of these.

    Does that make sense to you?

    Tom


    Thursday, July 9, 2020 6:52 PM
    Moderator
  • Tom,

    you say:

    The<w:pStyle> and <w:numPr> elements refer to styles.

    and that is the point we do not seem to agree on: <w:numPr> does not refer to a style in my reading of the spec. Instead, that is the only way (Part 1, §17.3.1.19) to specify direct numbering formatting properties on a paragraph. So, a numPr element under pPr on a p is - at least to my understanding of what is written in the spec - to be considered direct formatting, not style - at least as long as in the resolution hierarchy of that style instance, no numberingStyle is referenced (which it isn't in this case).

    Consequentially, only bullet #6 under §17.7.2 applies, which says: "Finally, we apply direct formatting (paragraph or run properties not from styles). If this direct formatting includes numbering, that numbering + the associated paragraph properties are applied." Reading that sentence it says:

    1. Apply local paragraph and run formatting. (In this case: the <ind> element.)
    2. Only if numPr is present: apply numbering and the paragraph properties defined in the numbering definition (here: the <w:ind w:left="720" w:hanging="360"/> in your example)

    Don't get me wrong: I see what actually happens. It's just that I still do not see this behavior backed by what is written in the combination of all relevant specs.

    Specifically to your answer: Where in the spec is defined that a list numbering instance is considered a style in terms of the property application hierarchy? I was not able to find this equivalence anywhere in the specs so far, so a pointer to where that's written would be highly appreciated and help me understand what's happening.

    Thanks,
    Christian

    Friday, July 10, 2020 7:38 AM
  • >>Don't get me wrong: I see what actually happens. It's just that I still do not see this behavior backed by what is written in the combination of all relevant specs.

    I agree that the wording in bullet #6 is indeed a little confusing and can be interpreted in different ways especially in light of Word's implemented interpretation. That was really my main point here. 

    >>Where in the spec is defined that a list numbering instance is considered a style in terms of the property application hierarchy? 

    I wasn't intending to define <numPr> specifically as a style and in my first post that was "eaten" by the MSDN forum (unfortunately) I think I did make the distinction between style and numbering parts. My main point in that was that the first five bullets refer to and deal with the order of defaults, styles and numbering parts and elements. The final bullet appears to be ambiguously defined as far as which is applied first. It doesn't actually explicitly say (in my reading of it) which order between numbering and other direct formatting.  So to me it could be taken that numbering is competing with say a style reference first or is just simple direct formatting and it's not clear that this is supposed to be last. 

    I will take this to the Word team and ask them to clarify what Word's implementation interprets this passage to be. Then we can decide if we need some additional verbiage in our implementation notes in [MS-OI29500] to clarify what that means. I do think that the 2.1.229 note is referring to the first five bullets but I'll also clarify that. 

    Thanks for hanging in there with me while I sort this out. 

    Tom 

    Friday, July 10, 2020 9:13 AM
    Moderator
  • Hi kriro, 

    Thanks for your patience. 

    The Word team confirms that Word applies properties in this order (with respect to paragraph properties in paragraph styles, and in numbering definitions), assuming we have a paragraph that is applying paragraph style “P1”.
    1. Properties from Numbering Definition applied from Style P1.
    2. Properties from Style P1
    3. Properties from Numbering Definition directly applied to paragraph
    4. Properties directly applied to paragraph

    Which you probably already know. 

    However, it seems the MS-OI29500 2.1.229 is ambiguous and should probably be something like this: 

    “Word applies the properties from a paragraph style applied to a paragraph before it applies the properties from a numbering style applied to a paragraph via numbering properties.”

    The subtle note there is that the numbering properties are direct formatting on the paragraph, so naturally the direct formatting properties (even though they are referencing a numbering style) would be applied after the paragraph style properties. This is only clear, however, if someone already understands that numbering styles do not participate in the style hierarchy as other styles do. (In fact, numbering styles only exist in the context of numbering definitions).

    Does this help to clarify? If so, I will request that MS-OI29500 2.1.229 be updated. 

    Tom
    Tuesday, July 21, 2020 11:22 PM
    Moderator
  • Hi Tom,

    sorry for the late reply.

    Thanks for confirming the actual application sequence of properties, which differs from what is written in OOXML part #1 and MS-OI29500. I consider this an error in the relevant specs, which I assume will be fixed in the next revision.

    Specifically, the errors are:

    (1) OOXML Part 1, §17.7.2: The graphic is correct (paragraph styles are applied *before* numbering styles), but the item order in the list below (btw., why is it bulleted, when sequence is of importance?) is wrong. Alternatively, it's the other way round: the list is right, but the graphics is wrong. Either way, one must be fixed.

    (2) Depending on the result of (1) above, MS-OI29500's difference description in §2.1.229 might need to get dropped. If it must stay, your suggested re-wording is an improvement in clarity.

    (3) The last bullet in OOXML part 1 §17.7.2 does not unambiguously define which direct properties are applied first. When reading, it could be construed by the sequence in which the information is presented, that paragraph properties specified in a referenced numbering definition are applied *after* direct paragraph properties specified on the paragraph. This, per info from the Word team you quoted, is *not* as it is implemented in Word. So either, the OOXML spec's last bullet in §17.7.2 must be fixed - but in any case made unambiguous -, or an additional sentence must be added to MS-OI29500 §2.1.229 that specifies that Word - contrary to the OOXML spec - applies direct paragraph properties specified on the paragraph *after* applying direct paragraph properties coming from a referenced numbering definition.

    Is this describing the situation correctly also in your opinion/reading?

    Thanks for investigating this issue,

    Christian


    • Edited by Kriro2019 Wednesday, August 5, 2020 8:06 PM
    Wednesday, August 5, 2020 8:06 PM
  • Thanks for getting back to me Christian. This area of the standard and notes is definitely problematic and I will respond shortly on your comments to clarify what we are planning to address and how.

    Tom

    Wednesday, August 5, 2020 9:54 PM
    Moderator
  • Hi Christian, 

    I think you had the gist of it but I'll clarify to make sure. 

    The graphic in the standard (§17.7.2) is wrong according to what Word does. Microsoft (my team) will submit a request to the standards body to ask them to resolve this confusion. 

    MS-OI29500 §2.1.229 is specifically only covering styles. My team will add another note to address the order of direct formatting application. We will also look at the original note to see if it needs further clarification or correction.

    So the order Word uses for applying formatting (assuming paragraphy style "P1") is: 

    1. Properties from Numbering Definition applied from Style P1.
    2. Properties from Style P1
    3. Properties from Numbering Definition directly applied to paragraph
    4. Properties directly applied to paragraph

    That should clarify the ordering wrt numbering and formatting for both styles and direct appliation.

    Let me know if this is not clear.

    Tom


    Friday, August 7, 2020 4:14 AM
    Moderator