none
Bold toggled on/off according to the rules, but is on in Word RRS feed

Answers

  • Hello Dave,

     

    Below I'm showing the relevant elements that you provided with unimportant elements omitted for clarity. I also modified the w:b element to include the w:val attribute for clarity.

     

    The document that you presented uses the following style that is relevant to the question:

     

    <w:style w:type="table" w:styleId="GridTable4-Accent5">
         <w:tblStylePr w:type="firstRow">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

        <w:tblStylePr w:type="lastRow">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

        <w:tblStylePr w:type="firstCol">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

          

        <w:tblStylePr w:type="lastCol">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

      </w:style>

     

    The table that you are inquiring about is referencing this style using the following elements:

     

        <w:tbl>

          <w:tblPr><u5:p></u5:p>

            <w:tblStyle w:val="GridTable4-Accent5"/>

            <w:tblW w:w="0" w:type="auto"/>

            <w:tblLook w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>

        </w:tbl>

     

    The table uses the conditional styles for the first row and first column only and is not using the style for the last row or column. There are no other styles referenced by any of the paragraphs/runs within this table - please let me know if I missed something. We are therefore only concerned with the two conditional table styles and how they interact together.

     

    I understand your question to be: Since both the conditional styles for first row and first column apply to the upper-left corner, which both include bold=true, why is the bold property not toggled off?

     

    Since the bold property is a toggle property, the following sections of the ISO/IEC 29500-1 document apply:

     

    17.7.3 Toggle Properties

    If the property is a toggle property, then its values, which are limited to true and false (or the equivalent values 1 and 0) shall be combined as follows:

    ...

    If multiple instances of the toggle property appear at the same level of the style hierarchy, then the first value encountered by the following algorithm shall be used (if no value is encountered, the property takes on its default value).

    ...

    If the value of the toggle property appears at multiple levels of the style hierarchy (§17.7.2), their effective values shall be combined as follows:

    ...

    Otherwise, the values are combined by a Boolean XOR as follows:

    (transcribed picture):

    value-effective = val-table XOR val-paragraph XOR val-character

    i.e., the effective value to be applied to the content shall be true if its effective value is true for an odd number of levels of the style hierarchy.

     

    Interpretation:

    The toggling, or XOR evaluation, of the toggle propreties only applies between different levels of hierarchy. It does not occur within each level, i.e. table. In our case, the evaluation of the bold property for the table is evaluated by using the first value encountered, in this case the firstRow conditional style.

     

    You can see that toggling will occur if you add a paragraph or run style with the bold property set to true and then use that style in the upper-left corner. For example, I added the following mark-up:

     

    document.xml:

    <w:r>

      <w:rStyle w:val="KamilChar"/>

       <w:t>Different table style</w:t>

    </w:r>

    styles.xml:

      </w:style>

        <w:style w:type="character" w:customStyle="1" w:styleId="KamilChar">

        <w:name w:val="Kamil Char"/>

        <w:basedOn w:val="DefaultParagraphFont"/>

           ...

        <w:rPr>

           <w:b w:val="true"/>

        </w:rPr>

      </w:style>

     

    When I did this, the upper-left corner of the table was no longer bold. Please let me know if you have reason to believe that this evaluation should be different.

     

    Thanks,

    Kamil


    Monday, April 25, 2016 2:57 PM

All replies

  • Hi David,

    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, April 16, 2016 5:44 AM
    Moderator
  • Hello David,

    I downloaded the file you provided and I'm looking into this issue for you.

    Thanks,
    Kamil

    Monday, April 18, 2016 7:29 PM
  • Hello Dave,

     

    Below I'm showing the relevant elements that you provided with unimportant elements omitted for clarity. I also modified the w:b element to include the w:val attribute for clarity.

     

    The document that you presented uses the following style that is relevant to the question:

     

    <w:style w:type="table" w:styleId="GridTable4-Accent5">
         <w:tblStylePr w:type="firstRow">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

        <w:tblStylePr w:type="lastRow">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

        <w:tblStylePr w:type="firstCol">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

          

        <w:tblStylePr w:type="lastCol">

          <w:rPr>

            <w:b w:val="true"/>

          </w:rPr>

        </w:tblStylePr>

      </w:style>

     

    The table that you are inquiring about is referencing this style using the following elements:

     

        <w:tbl>

          <w:tblPr><u5:p></u5:p>

            <w:tblStyle w:val="GridTable4-Accent5"/>

            <w:tblW w:w="0" w:type="auto"/>

            <w:tblLook w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>

        </w:tbl>

     

    The table uses the conditional styles for the first row and first column only and is not using the style for the last row or column. There are no other styles referenced by any of the paragraphs/runs within this table - please let me know if I missed something. We are therefore only concerned with the two conditional table styles and how they interact together.

     

    I understand your question to be: Since both the conditional styles for first row and first column apply to the upper-left corner, which both include bold=true, why is the bold property not toggled off?

     

    Since the bold property is a toggle property, the following sections of the ISO/IEC 29500-1 document apply:

     

    17.7.3 Toggle Properties

    If the property is a toggle property, then its values, which are limited to true and false (or the equivalent values 1 and 0) shall be combined as follows:

    ...

    If multiple instances of the toggle property appear at the same level of the style hierarchy, then the first value encountered by the following algorithm shall be used (if no value is encountered, the property takes on its default value).

    ...

    If the value of the toggle property appears at multiple levels of the style hierarchy (§17.7.2), their effective values shall be combined as follows:

    ...

    Otherwise, the values are combined by a Boolean XOR as follows:

    (transcribed picture):

    value-effective = val-table XOR val-paragraph XOR val-character

    i.e., the effective value to be applied to the content shall be true if its effective value is true for an odd number of levels of the style hierarchy.

     

    Interpretation:

    The toggling, or XOR evaluation, of the toggle propreties only applies between different levels of hierarchy. It does not occur within each level, i.e. table. In our case, the evaluation of the bold property for the table is evaluated by using the first value encountered, in this case the firstRow conditional style.

     

    You can see that toggling will occur if you add a paragraph or run style with the bold property set to true and then use that style in the upper-left corner. For example, I added the following mark-up:

     

    document.xml:

    <w:r>

      <w:rStyle w:val="KamilChar"/>

       <w:t>Different table style</w:t>

    </w:r>

    styles.xml:

      </w:style>

        <w:style w:type="character" w:customStyle="1" w:styleId="KamilChar">

        <w:name w:val="Kamil Char"/>

        <w:basedOn w:val="DefaultParagraphFont"/>

           ...

        <w:rPr>

           <w:b w:val="true"/>

        </w:rPr>

      </w:style>

     

    When I did this, the upper-left corner of the table was no longer bold. Please let me know if you have reason to believe that this evaluation should be different.

     

    Thanks,

    Kamil


    Monday, April 25, 2016 2:57 PM
  • Thank you. I missed

    If multiple instances of the toggle property appear at the same level of the style hierarchy, then the first value encountered by the following algorithm shall be used (if no value is encountered, the property takes on its default value).

    And that does explain it.

    thanks - dave

    ps - I want to say once again, this is one of the weirdest settings in Word.


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Monday, April 25, 2016 3:23 PM