ECMA376のリファレンスを使ってxlsxファイルの中身を見る。

Excel2007から拡張子がxlsx、Office Open XML形式をサポートするようになったこと、xlsxファイルはxmlファイルをzip圧縮したものであることはみなさんご存知だと思います。

しかし、中身のxmlファイルについてはみなさんよく知らないと思いますので、この記事では、その中身について少し読めるようになりみましょう、という内容を書きたいと思います。

中身を読み解くのは簡単です。ECMA376で標準化されているため、立派なリファレンスがあります。現在は4版まで出ており、各版はPart1~Part4まで分けてファイルが存在するため、ECMA-376 4th edition Part 1~ECMA-376 4th edition Part 4を読めば、現在の仕様が分かるということになっています。非常に簡単ですね。

では、リファレンスのpdfを開いて読んでみましょう。
ECMA-376 4th edition Part 1のリンクをクリックして、zipファイルを展開して、PDFを開いて・・・。

・・・

ちょっと、5000ページというのは厳しいですね。

というわけで、方向転換して、ECMA-376のリファレンスと突き合わせながら、Excelで設定した内容とxmlファイルがどう対応しているのかを見て行くという、しょうもないことをやろうと思います。(ここまでが記事の説明)

※なお、少し時間がなく出してしまっているので、誤りがあり可能性があります。
記述内容に誤りがあった場合には訂正させていただきますので、コメントなどで指摘いただければと思います。


というわけで、ここから作業をしていきます。

まず、何も記入していないブックを用意します。

f:id:gototo:20151207143519p:plain

このブックをno-edited.xlsxというファイル名で保存し、拡張子をzipに変更して、展開します。

f:id:gototo:20151207144143p:plain

さて、ようやくxmlファイルが出てきました。
最初の[Content_Types].xmlファイルを見てみましょう。

<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
  <Default Extension="rels"
    ContentType="application/vnd.openxmlformats-package.relationships+xml" />
  <Default Extension="xml" ContentType="application/xml" />
  <Override PartName="/xl/workbook.xml"
    ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" />
  <Override PartName="/xl/worksheets/sheet1.xml"
    ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />
  <Override PartName="/xl/theme/theme1.xml"
    ContentType="application/vnd.openxmlformats-officedocument.theme+xml" />
  <Override PartName="/xl/styles.xml"
    ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" />
  <Override PartName="/docProps/core.xml"
    ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
  <Override PartName="/docProps/app.xml"
    ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />
</Types>

xmlnsで
http://schemas.openxmlformats.org/package/2006/content-types
を指定しています。
他は。。。rels、xml、...よく分かりませんね。
しかし、なんとなく、Override PartName要素は展開されたファイルパスと合致していそうです。
あ、そうそう、展開したファイルの一覧は↓のようになっています。
/
┣[Content_Types].xml
┣_rels/
┃ ┗.rels
┣docProps/
┃ ┣app.xml
┃ ┗core.xml
┗xl/
  ┣styles.xml
  ┣workbook.xml
  ┣_rels/
  ┃ ┗workbook.xml.rels
  ┣theme/
  ┃ ┗theme1.xml
  ┗worksheets/
    ┗sheet1.xml

どれもぱっと見、よく分からないので、とりあえず、階層が浅いもの→ファイルが少ないフォルダの順に見て行きましょう。
.relsファイルはこうなっています。

<Relationships
  xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId3"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
    Target="docProps/app.xml" />
  <Relationship Id="rId2"
    Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"
    Target="docProps/core.xml" />
  <Relationship Id="rId1"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
    Target="xl/workbook.xml" />
</Relationships>

app.xmlとか、core.xmlとか見たことがあるファイルがいますね。
.relsという名前からもこのファイルがzipファイル内の関連を記述しているような感じがあります。

次にapp.xmlです。

<Properties
  xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
  xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
  <Application>Microsoft Excel</Application>
  <DocSecurity>0</DocSecurity>
  <ScaleCrop>false</ScaleCrop>
  <HeadingPairs>
    <vt:vector size="2" baseType="variant">
      <vt:variant>
        <vt:lpstr>ワークシート</vt:lpstr>
      </vt:variant>
      <vt:variant>
        <vt:i4>1</vt:i4>
      </vt:variant>
    </vt:vector>
  </HeadingPairs>
  <TitlesOfParts>
    <vt:vector size="1" baseType="lpstr">
      <vt:lpstr>Sheet1</vt:lpstr>
    </vt:vector>
  </TitlesOfParts>
  <Company />
  <LinksUpToDate>false</LinksUpToDate>
  <SharedDoc>false</SharedDoc>
  <HyperlinksChanged>false</HyperlinksChanged>
  <AppVersion>15.0300</AppVersion>
</Properties>

この辺りから、少しだけ意味の分かるものが出てきます。まず、Application要素ですが、これは何でしょうか。
Office Open XMLでは、他のofficeソフトも同様にxml形式であるため、Microsoft Excel用のファイルであるということを明示しているのでしょうか。
あと、"ワークシート"という日本語がいきなり出てきたのも気になります。
最後のAppVersionはExcel2013のバージョンで保存したことを表現しているのでしょうか。
この記事を書くのに使用したExcelはExcel2013で、バージョン情報を表示すると、15.0.4771.1000と表示されました。
この辺りで各要素の意味を知りたくなったので、PDF(Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf)内で検索してみましょう。
1203ページにある『17.16.5.14 DOCPROPERTY』辺りが定義でしょうか。
MSDN辺りでも検索してみると、下記のようなページがひっかかります。

https://msdn.microsoft.com/ja-jp/library/documentformat.openxml.extendedproperties.scalecrop(v=office.14).aspx

なるほど、ScaleCropはファイルをサムネイル表示するモードなんですかね。ってそんなのあったのか。(ググったらある・・・!)。

では、サムネイル表示されるファイルを作って

f:id:gototo:20151207170632p:plain

ファイルを展開して中身を見てみましょう。

<Properties
  xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
  xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
  <Application>Microsoft Excel</Application>
  <DocSecurity>0</DocSecurity>
  <ScaleCrop>false</ScaleCrop>
  <HeadingPairs>
    <vt:vector size="2" baseType="variant">
      <vt:variant>
        <vt:lpstr>ワークシート</vt:lpstr>
      </vt:variant>
      <vt:variant>
        <vt:i4>1</vt:i4>
      </vt:variant>
    </vt:vector>
  </HeadingPairs>
  <TitlesOfParts>
    <vt:vector size="1" baseType="lpstr">
      <vt:lpstr>Sheet1</vt:lpstr>
    </vt:vector>
  </TitlesOfParts>
  <Company />
  <LinksUpToDate>false</LinksUpToDate>
  <SharedDoc>false</SharedDoc>
  <HyperlinksChanged>false</HyperlinksChanged>
  <AppVersion>15.0300</AppVersion>
</Properties>

あれ、変わってない!?
ああ、サムネイル表示するモードではなくて、サムネイルが表示モードによって大きいものになったり小さいものになったりするモードのON/OFF表現なんですね。
ただ、それをExcelで設定する方法が分からない。。。これについてはここまでとします。
ScaleCrop以外の要素についてもMSDNには記述されているので、もし必要になったら読むとよさそうです。
https://msdn.microsoft.com/ja-jp/library/documentformat.openxml.extendedproperties(v=office.14).aspx

さて、ScaleCropをtrueにする方法を色々ググったりしていたせいで時間も気力もなくなりつつありますが、
気を取り直して、core.xmlです。

<cp:coreProperties
  xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <dc:creator>○○ △△</dc:creator>
  <cp:lastModifiedBy>○○ △△</cp:lastModifiedBy>
  <dcterms:created xsi:type="dcterms:W3CDTF">2015-12-07T04:59:38Z</dcterms:created>
  <dcterms:modified xsi:type="dcterms:W3CDTF">2015-12-07T05:00:16Z</dcterms:modified>
</cp:coreProperties>

おや、これはファイルのプロパティの情報のようですね。
各プロパティの内容はEcma Office Open XML Part 2 - Open Packaging Conventions.pdfの41ページ付近に書いてあります。
pdfファイルを見ると、4要素だけではないですね。タイトルやバージョン番号など、様々な要素を設定することができるようです。
そういうば、確かにWindowsでファイルのプロパティ情報を見ても4要素以外にたくさん設定されています。

さて、ここまでエクセルファイルの中身について記述がされていないですね。
ということは残っているxl/フォルダ以下がエクセルファイルの中身(シートの情報など)を表現しているのでしょうきっと。
では、xlフォルダの中身を見ていきます。

まずはxl/styles.xmlです。

<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
  mc:Ignorable="x14ac">
  <fonts count="2" x14ac:knownFonts="1">
    <font>
      <sz val="9" />
      <color theme="1" />
      <name val="Meiryo UI" />
      <family val="2" />
      <charset val="128" />
    </font>
    <font>
      <sz val="6" />
      <name val="Meiryo UI" />
      <family val="2" />
      <charset val="128" />
    </font>
  </fonts>
  <fills count="2">
    <fill>
      <patternFill patternType="none" />
    </fill>
    <fill>
      <patternFill patternType="gray125" />
    </fill>
  </fills>
  <borders count="1">
    <border>
      <left />
      <right />
      <top />
      <bottom />
      <diagonal />
    </border>
  </borders>
  <cellStyleXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0">
      <alignment vertical="center" />
    </xf>
  </cellStyleXfs>
  <cellXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0">
      <alignment vertical="center" />
    </xf>
  </cellXfs>
  <cellStyles count="1">
    <cellStyle name="標準" xfId="0" builtinId="0" />
  </cellStyles>
  <dxfs count="0" />
  <tableStyles count="0" defaultTableStyle="TableStyleMedium2"
    defaultPivotStyle="PivotStyleLight16" />
  <extLst>
    <ext xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
      uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}">
      <x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1" />
    </ext>
    <ext xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
      uri="{9260A510-F301-46a8-8635-F512D64BE5F5}">
      <x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1" />
    </ext>
  </extLst>
</styleSheet>

styles.xmlはファイル名の通り、書式スタイルを定義しているように見えますね。
また、ここにも"標準"と日本語が設定されています。これはエクセルのリボンにあるスタイルのうち、左上にある文字列を表現しているのでしょうか?
あとは最後のext要素の中身は何を指しているのかよく分かりませんね。

PDF(Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf)内で見てみると、1744ページにある『18.8 Styles』辺りが定義のように見えます。
しかし、探すのも読むのも大変ですね。
ここはwebの力を使って、PDF検索より楽なものを探しましょう。
というわけで、↓を使います。

OOXML - Complete documentation and samples

さて、検索が楽になったので、font要素の最初のものを下記を参考に見てみましょう。

OOXML ssml:font - Complete documentation and samples

    <font>
      <sz val="9" />
      <color theme="1" />
      <name val="Meiryo UI" />
      <family val="2" />
      <charset val="128" />
    </font>

フォントサイズが9。
カラーテーマが1。
フォント名はMeiryo UI。
フォントファミリは2。
キャラクタセットは128。
ところどころよく分からないですが、これらもPDFを使ったり、ググったりすればなんとかなりそうな感がありますね。

例えば、キャラクタセットは私はぱっと見で全然分からなかったのですが、PDFを見たところ、Valueに対応した文字コードを使う事が分かります。
で、今回のものは128。つまり0x80*1shift_jisのようです。

フォントファミリはPDF(18.18.94 ST_FontFamily (Font Family)の項)を見て、
Romanを指定しているということが分かります。
なんとなく、こうやっていくと大抵のものはなんとかなりそうですね。

もう時間がないので、さっさと行きます。
次にxl/workbook.xmlです。

<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
  mc:Ignorable="x15">
  <fileVersion appName="xl" lastEdited="6" lowestEdited="6"
    rupBuild="14420" />
  <workbookPr defaultThemeVersion="153222" />
  <mc:AlternateContent
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <mc:Choice Requires="x15">
      <x15ac:absPath
        xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"
        url="C:\Users\USERNAME\Desktop\ecma作る\" />
    </mc:Choice>
  </mc:AlternateContent>
  <bookViews>
    <workbookView xWindow="0" yWindow="0" windowWidth="10065"
      windowHeight="3480" />
  </bookViews>
  <sheets>
    <sheet name="Sheet1" sheetId="1" r:id="rId1" />
  </sheets>
  <calcPr calcId="152511" />
  <extLst>
    <ext xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
      uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}">
      <x15:workbookPr chartTrackingRefBase="1" />
    </ext>
  </extLst>
</workbook>

これはファイルパスやアプリケーションの情報を保存しているxmlファイルでしょうか。
xWindow="0" yWindow="0" windowWidth="10065" windowHeight="3480"
などの値はwindowサイズのように見えます。このようなものも保存してあるのですね。
詳細は省略します。

次はxl/_rels/workbook.xml.relsです。

<Relationships
  xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId3"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
    Target="styles.xml" />
  <Relationship Id="rId2"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
    Target="theme/theme1.xml" />
  <Relationship Id="rId1"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
    Target="worksheets/sheet1.xml" />
</Relationships>

xmlファイルがそれぞれどういう役割をしているかを記述しています。


次はxl/theme/theme.xmlです。

<Relationships
  xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId3"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
    Target="styles.xml" />
  <Relationship Id="rId2"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
    Target="theme/theme1.xml" />
  <Relationship Id="rId1"
    Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
    Target="worksheets/sheet1.xml" />
</Relationships>

xmlファイルがそれぞれどういう役割をしているかを記述しています。

<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
  name="Office テーマ">
  <a:themeElements>
    <a:clrScheme name="Office">
      <a:dk1>
        <a:sysClr val="windowText" lastClr="000000" />
      </a:dk1>
      <a:lt1>
        <a:sysClr val="window" lastClr="FFFFFF" />
      </a:lt1>
      <a:dk2>
        <a:srgbClr val="44546A" />
      </a:dk2>
      <a:lt2>
        <a:srgbClr val="E7E6E6" />
      </a:lt2>
      <a:accent1>
        <a:srgbClr val="5B9BD5" />
      </a:accent1>
      <a:accent2>
        <a:srgbClr val="ED7D31" />
      </a:accent2>
      <a:accent3>
        <a:srgbClr val="A5A5A5" />
      </a:accent3>
      <a:accent4>
        <a:srgbClr val="FFC000" />
      </a:accent4>
      <a:accent5>
        <a:srgbClr val="4472C4" />
      </a:accent5>
      <a:accent6>
        <a:srgbClr val="70AD47" />
      </a:accent6>
      <a:hlink>
        <a:srgbClr val="0563C1" />
      </a:hlink>
      <a:folHlink>
        <a:srgbClr val="954F72" />
      </a:folHlink>
    </a:clrScheme>
    <a:fontScheme name="Office">
      <a:majorFont>
        <a:latin typeface="Calibri Light" panose="020F0302020204030204" />
        <a:ea typeface="" />
        <a:cs typeface="" />
        <a:font script="Jpan" typeface="MS Pゴシック" />
        <a:font script="Hang" typeface="?? ??" />
        <a:font script="Hans" typeface="宋体" />
        <a:font script="Hant" typeface="新細明體" />
        <a:font script="Arab" typeface="Times New Roman" />
        <a:font script="Hebr" typeface="Times New Roman" />
        <a:font script="Thai" typeface="Tahoma" />
        <a:font script="Ethi" typeface="Nyala" />
        <a:font script="Beng" typeface="Vrinda" />
        <a:font script="Gujr" typeface="Shruti" />
        <a:font script="Khmr" typeface="MoolBoran" />
        <a:font script="Knda" typeface="Tunga" />
        <a:font script="Guru" typeface="Raavi" />
        <a:font script="Cans" typeface="Euphemia" />
        <a:font script="Cher" typeface="Plantagenet Cherokee" />
        <a:font script="Yiii" typeface="Microsoft Yi Baiti" />
        <a:font script="Tibt" typeface="Microsoft Himalaya" />
        <a:font script="Thaa" typeface="MV Boli" />
        <a:font script="Deva" typeface="Mangal" />
        <a:font script="Telu" typeface="Gautami" />
        <a:font script="Taml" typeface="Latha" />
        <a:font script="Syrc" typeface="Estrangelo Edessa" />
        <a:font script="Orya" typeface="Kalinga" />
        <a:font script="Mlym" typeface="Kartika" />
        <a:font script="Laoo" typeface="DokChampa" />
        <a:font script="Sinh" typeface="Iskoola Pota" />
        <a:font script="Mong" typeface="Mongolian Baiti" />
        <a:font script="Viet" typeface="Times New Roman" />
        <a:font script="Uigh" typeface="Microsoft Uighur" />
        <a:font script="Geor" typeface="Sylfaen" />
      </a:majorFont>
      <a:minorFont>
        <a:latin typeface="Calibri" panose="020F0502020204030204" />
        <a:ea typeface="" />
        <a:cs typeface="" />
        <a:font script="Jpan" typeface="MS Pゴシック" />
        <a:font script="Hang" typeface="?? ??" />
        <a:font script="Hans" typeface="宋体" />
        <a:font script="Hant" typeface="新細明體" />
        <a:font script="Arab" typeface="Arial" />
        <a:font script="Hebr" typeface="Arial" />
        <a:font script="Thai" typeface="Tahoma" />
        <a:font script="Ethi" typeface="Nyala" />
        <a:font script="Beng" typeface="Vrinda" />
        <a:font script="Gujr" typeface="Shruti" />
        <a:font script="Khmr" typeface="DaunPenh" />
        <a:font script="Knda" typeface="Tunga" />
        <a:font script="Guru" typeface="Raavi" />
        <a:font script="Cans" typeface="Euphemia" />
        <a:font script="Cher" typeface="Plantagenet Cherokee" />
        <a:font script="Yiii" typeface="Microsoft Yi Baiti" />
        <a:font script="Tibt" typeface="Microsoft Himalaya" />
        <a:font script="Thaa" typeface="MV Boli" />
        <a:font script="Deva" typeface="Mangal" />
        <a:font script="Telu" typeface="Gautami" />
        <a:font script="Taml" typeface="Latha" />
        <a:font script="Syrc" typeface="Estrangelo Edessa" />
        <a:font script="Orya" typeface="Kalinga" />
        <a:font script="Mlym" typeface="Kartika" />
        <a:font script="Laoo" typeface="DokChampa" />
        <a:font script="Sinh" typeface="Iskoola Pota" />
        <a:font script="Mong" typeface="Mongolian Baiti" />
        <a:font script="Viet" typeface="Arial" />
        <a:font script="Uigh" typeface="Microsoft Uighur" />
        <a:font script="Geor" typeface="Sylfaen" />
      </a:minorFont>
    </a:fontScheme>
    <a:fmtScheme name="Office">
      <a:fillStyleLst>
        <a:solidFill>
          <a:schemeClr val="phClr" />
        </a:solidFill>
        <a:gradFill rotWithShape="1">
          <a:gsLst>
            <a:gs pos="0">
              <a:schemeClr val="phClr">
                <a:lumMod val="110000" />
                <a:satMod val="105000" />
                <a:tint val="67000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="50000">
              <a:schemeClr val="phClr">
                <a:lumMod val="105000" />
                <a:satMod val="103000" />
                <a:tint val="73000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="100000">
              <a:schemeClr val="phClr">
                <a:lumMod val="105000" />
                <a:satMod val="109000" />
                <a:tint val="81000" />
              </a:schemeClr>
            </a:gs>
          </a:gsLst>
          <a:lin ang="5400000" scaled="0" />
        </a:gradFill>
        <a:gradFill rotWithShape="1">
          <a:gsLst>
            <a:gs pos="0">
              <a:schemeClr val="phClr">
                <a:satMod val="103000" />
                <a:lumMod val="102000" />
                <a:tint val="94000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="50000">
              <a:schemeClr val="phClr">
                <a:satMod val="110000" />
                <a:lumMod val="100000" />
                <a:shade val="100000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="100000">
              <a:schemeClr val="phClr">
                <a:lumMod val="99000" />
                <a:satMod val="120000" />
                <a:shade val="78000" />
              </a:schemeClr>
            </a:gs>
          </a:gsLst>
          <a:lin ang="5400000" scaled="0" />
        </a:gradFill>
      </a:fillStyleLst>
      <a:lnStyleLst>
        <a:ln w="6350" cap="flat" cmpd="sng" algn="ctr">
          <a:solidFill>
            <a:schemeClr val="phClr" />
          </a:solidFill>
          <a:prstDash val="solid" />
          <a:miter lim="800000" />
        </a:ln>
        <a:ln w="12700" cap="flat" cmpd="sng" algn="ctr">
          <a:solidFill>
            <a:schemeClr val="phClr" />
          </a:solidFill>
          <a:prstDash val="solid" />
          <a:miter lim="800000" />
        </a:ln>
        <a:ln w="19050" cap="flat" cmpd="sng" algn="ctr">
          <a:solidFill>
            <a:schemeClr val="phClr" />
          </a:solidFill>
          <a:prstDash val="solid" />
          <a:miter lim="800000" />
        </a:ln>
      </a:lnStyleLst>
      <a:effectStyleLst>
        <a:effectStyle>
          <a:effectLst />
        </a:effectStyle>
        <a:effectStyle>
          <a:effectLst />
        </a:effectStyle>
        <a:effectStyle>
          <a:effectLst>
            <a:outerShdw blurRad="57150" dist="19050" dir="5400000"
              algn="ctr" rotWithShape="0">
              <a:srgbClr val="000000">
                <a:alpha val="63000" />
              </a:srgbClr>
            </a:outerShdw>
          </a:effectLst>
        </a:effectStyle>
      </a:effectStyleLst>
      <a:bgFillStyleLst>
        <a:solidFill>
          <a:schemeClr val="phClr" />
        </a:solidFill>
        <a:solidFill>
          <a:schemeClr val="phClr">
            <a:tint val="95000" />
            <a:satMod val="170000" />
          </a:schemeClr>
        </a:solidFill>
        <a:gradFill rotWithShape="1">
          <a:gsLst>
            <a:gs pos="0">
              <a:schemeClr val="phClr">
                <a:tint val="93000" />
                <a:satMod val="150000" />
                <a:shade val="98000" />
                <a:lumMod val="102000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="50000">
              <a:schemeClr val="phClr">
                <a:tint val="98000" />
                <a:satMod val="130000" />
                <a:shade val="90000" />
                <a:lumMod val="103000" />
              </a:schemeClr>
            </a:gs>
            <a:gs pos="100000">
              <a:schemeClr val="phClr">
                <a:shade val="63000" />
                <a:satMod val="120000" />
              </a:schemeClr>
            </a:gs>
          </a:gsLst>
          <a:lin ang="5400000" scaled="0" />
        </a:gradFill>
      </a:bgFillStyleLst>
    </a:fmtScheme>
  </a:themeElements>
  <a:objectDefaults />
  <a:extraClrSchemeLst />
  <a:extLst>
    <a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}">
      <thm15:themeFamily
        xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main"
        name="Office Theme" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{4A3C46E8-61CC-4603-A589-7422A47A8E4A}" />
    </a:ext>
  </a:extLst>
</a:theme>

ここに来て、長いファイルですね。。。
心が少し折れそうになりましたが、中身は単純に見えます。
これはExcelのテーマですね。私のExcelにはこんなにも多くのテーマが設定されていたのか。

さて、いよいよ最後のファイルです。xl/worksheets/sheet1.xmlは下記のようになっています。

<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
  mc:Ignorable="x14ac">
  <dimension ref="A1" />
  <sheetViews>
    <sheetView tabSelected="1" workbookViewId="0" />
  </sheetViews>
  <sheetFormatPr defaultRowHeight="12" x14ac:dyDescent="0.2" />
  <sheetData />
  <phoneticPr fontId="1" />
  <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75"
    header="0.3" footer="0.3" />
</worksheet>

おお、これはシートの情報ですね。
シート名がない?と思いましたが、xl/workbook.xmlに記述してあります。
dimension情報から、初期フォーカス一をA1にしていること、
sheetView情報からシートタブが選択状態にあるという情報が読み取れます。
他はシートのデフォルト情報ですね。
デフォルト行高さ、
デフォルト列幅、
フォント、
印刷ページのマージン

以上で、ようやく空のファイルの情報を読み取ることが出来ました。
本当はこの後に、ファイルをExcelを使用せずに作成してみれば、どういう要素がどういう関連を持って、
設定されているのかがよく分かるのですが、それは別の場所で書こうと思います。

最後に、なぜこんな重いテーマをこの12/7に書こうと思ったかという説明を少しだけ書こうと思います。
ECMA-376というのは説明なしで記述していますが、この初版は2006の12/7に出ているのです。

f:id:gototo:20151208004234p:plain
(https://en.wikipedia.org/wiki/Office_Open_XML)

というわけで、

ハッピーバースデー ECMA-376!

9歳の誕生日おめでとう!

(日付は変わってしまっていますが、まだアメリカ時間とかだと12/7の筈なのでセーフ)

業務アプリケーションはExcelと切っても切り離せない関係になってしまっているので
Office Open XMLがなくなることは今後もそうそうないでしょう。
私達に仕事をさせてくれるXMLの仕様に感謝をこめてこの記事を終わりたいと思います。

*1:10進数→16進数は(数字) to hex。16進数→10進数は(16進数) to decimalでググるのが便利です。