Re: Looking at the XML under the hood of Word ... how to identify column headers?

"l@tlo" <[email protected]> Tue, 2 May 2023 10:06:51 +0900
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
Roger,

You may want to check the various MS documents that define the format:

https://learn.microsoft.com/en-us/search/?terms=tblHeader

Also, the ECMA reference probably has all the information you need:

https://www.ecma-international.org/publications-and-standards/standards/ecma-376/

Jean-Christophe Helary

> On May 2, 2023, at 2:04, Roger L Costello <[email protected]> wrote:
> 
> Hi Folks,
> 
> When I create a table in Word I want to explicitly indicate that “this cell is a column header”. See screenshot at bottom of this message.
>  
> You probably know that under-the-hood of Word is XML. I will be writing software to process the XML, so I need something in the XML which indicates that a cell is a column header. Bold-facing the first row of a table is a good visual cue to a human reader that the items in the row are column headers, but bold-facing is of no help to software.
>  
> I did some Googling and found this suggestion for indicating a column header: highlight the first row, right-mouse click, select Table Properties, click on the Row tab, select “Repeat as header row at the top of each page” and unselect “Allow row to break across pages”.
>  
> Okay, I did that and then examined the XML that was generated. See below for the XML of the first row of the table. As far as I can tell, the <w:tblHeader/> element is used to indicate “This row contains the column headers”. Do you agree? Does Word provide any other way to identify column headers? /Roger
>  
> <w:tr ...>
>     <w:trPr>
>         <w:cantSplit/>
>         <w:tblHeader/>
>     </w:trPr>
>     <w:tc>
>         <w:tcPr>
>             <w:tcW w:w="0" w:type="auto"/>
>         </w:tcPr>
>         <w:p ...>
>             <w:pPr>
>                 <w:rPr>
>                     <w:b/>
>                     <w:bCs/>
>                 </w:rPr>
>             </w:pPr>
>             <w:proofErr w:type="spellStart"/>
>             <w:r w:rsidRPr="002C7789">
>                 <w:rPr>
>                     <w:b/>
>                     <w:bCs/>
>                 </w:rPr>
>                 <w:t>Vehicle_Type</w:t>
>             </w:r>
>             <w:proofErr w:type="spellEnd"/>
>         </w:p>
>     </w:tc>
>     <w:tc>
>         <w:tcPr>
>             <w:tcW w:w="0" w:type="auto"/>
>         </w:tcPr>
>         <w:p ...>
>             <w:pPr>
>                 <w:rPr>
>                     <w:b/>
>                     <w:bCs/>
>                 </w:rPr>
>             </w:pPr>
>             <w:r w:rsidRPr="002C7789">
>                 <w:rPr>
>                     <w:b/>
>                     <w:bCs/>
>                 </w:rPr>
>                 <w:t>Sensitivity</w:t>
>             </w:r>
>         </w:p>
>     </w:tc>
> </w:tr>
>  
>  
> <image001.png>

-- 
Jean-Christophe Helary @[email protected]
https://traductaire-libre.org
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: [email protected]
subscribe: [email protected]
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php