具有 w:type="table" 和 w:default="1" 属性的 w:style 是否会自动应用于没有 w:tbl 样式的 w:tbl?

Does the w:style with the w:type="table" and w:default="1" attribute automatically apply to a w:tbl without a w:tblStyle?

我发现 table 有填充样式,但它的 w:tbl 没有 w:tblStyle。在这种情况下,具有 w:type="table"w:default="1" 属性的 w:style 是否有效果?

背景是我正在使用 XSLT 转换 Open XML 标记。

您问题的简短回答是"Yes";如果没有明确指定样式,将应用默认样式。

WordprocessingML 中有四种不同类型的样式,即 paragraphcharactertablenumbering 样式。对于每种类型(例如,table),一种样式通过属性 w:default="1" 被标记为相关 Open XML 元素(例如,w:tbl 元素)的默认样式。典型的默认样式如下所示:

  <w:style w:type="paragraph" w:default="1" w:styleId="Normal">
    <w:name w:val="Normal"/>
    <w:qFormat/>
  </w:style>

  <w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
    <w:name w:val="Default Paragraph Font"/>
    <w:uiPriority w:val="1"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
  </w:style>

  <w:style w:type="table" w:default="1" w:styleId="TableNormal">
    <w:name w:val="Normal Table"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:tblPr>
      <w:tblInd w:w="0" w:type="dxa"/>
      <w:tblCellMar>
        <w:top w:w="0" w:type="dxa"/>
        <w:left w:w="108" w:type="dxa"/>
        <w:bottom w:w="0" w:type="dxa"/>
        <w:right w:w="108" w:type="dxa"/>
      </w:tblCellMar>
    </w:tblPr>
  </w:style>

  <w:style w:type="numbering" w:default="1" w:styleId="NoList">
    <w:name w:val="No List"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
  </w:style>

例如,如果您有 w:p(段落)、w:r(运行)或 w:tbl(table)元素而没有显式分配给它们的样式(例如,使用 w:pStylew:rStylew:tblStyle),将应用这些类型元素的默认样式。