1 #!C:/dev/python25/python.exe
5 A simple "this is a test." string and the output.
6 >>> test_wordml( "this is a test." )
7 <w:wordDocument xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" w:embeddedObjPresent="no" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xml:space="preserve" w:ocxPresent="no" xmlns:w10="urn:schemas-microsoft-com:office:word" w:macrosPresent="no" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" >
8 <w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2" ></w:ignoreElements>
10 <w:defaultFonts w:h-ansi="Times New Roman" w:fareast="Times New Roman" w:cs="Times New Roman" w:ascii="Times New Roman" ></w:defaultFonts>
11 <w:font w:name="Wingdings" >
12 <w:panose-1 w:val="05000000000000000000" ></w:panose-1>
13 <w:charset w:val="02" ></w:charset>
14 <w:family w:val="Auto" ></w:family>
15 <w:pitch w:val="variable" ></w:pitch>
16 <w:sig w:csb-1="00000000" w:csb-0="80000000" w:usb-3="00000000" w:usb-2="00000000" w:usb-1="10000000" w:usb-0="00000000" ></w:sig>
20 <w:listDef w:listDefId="0" >
21 <w:plt w:val="HybridMultilevel" ></w:plt>
22 <w:tmpl w:val="9C26005E" ></w:tmpl>
23 <w:lvl w:ilvl="0" w:tplc="0409000F" >
24 <w:start w:val="1" ></w:start>
25 <w:lvlText w:val="%1." ></w:lvlText>
26 <w:lvlJc w:val="left" ></w:lvlJc>
29 <w:tab w:val="list" w:pos="720" ></w:tab>
31 <w:ind w:hanging="360" w:left="720" ></w:ind>
34 <w:lvl w:ilvl="1" w:tplc="04090019" >
35 <w:start w:val="1" ></w:start>
36 <w:nfc w:val="4" ></w:nfc>
37 <w:lvlText w:val="%2." ></w:lvlText>
38 <w:lvlJc w:val="left" ></w:lvlJc>
41 <w:tab w:val="list" w:pos="1440" ></w:tab>
43 <w:ind w:hanging="360" w:left="1440" ></w:ind>
46 <w:lvl w:ilvl="2" w:tplc="0409001B" >
47 <w:start w:val="1" ></w:start>
48 <w:nfc w:val="2" ></w:nfc>
49 <w:lvlText w:val="%3." ></w:lvlText>
50 <w:lvlJc w:val="right" ></w:lvlJc>
53 <w:tab w:val="list" w:pos="2160" ></w:tab>
55 <w:ind w:hanging="180" w:left="2160" ></w:ind>
58 <w:lvl w:ilvl="3" w:tplc="0409000F" >
59 <w:start w:val="1" ></w:start>
60 <w:lvlText w:val="%4." ></w:lvlText>
61 <w:lvlJc w:val="left" ></w:lvlJc>
64 <w:tab w:val="list" w:pos="2880" ></w:tab>
66 <w:ind w:hanging="360" w:left="2880" ></w:ind>
69 <w:lvl w:ilvl="4" w:tplc="04090019" >
70 <w:start w:val="1" ></w:start>
71 <w:nfc w:val="4" ></w:nfc>
72 <w:lvlText w:val="%5." ></w:lvlText>
73 <w:lvlJc w:val="left" ></w:lvlJc>
76 <w:tab w:val="list" w:pos="3600" ></w:tab>
78 <w:ind w:hanging="360" w:left="3600" ></w:ind>
81 <w:lvl w:ilvl="5" w:tplc="0409001B" >
82 <w:start w:val="1" ></w:start>
83 <w:nfc w:val="2" ></w:nfc>
84 <w:lvlText w:val="%6." ></w:lvlText>
85 <w:lvlJc w:val="right" ></w:lvlJc>
88 <w:tab w:val="list" w:pos="4320" ></w:tab>
90 <w:ind w:hanging="180" w:left="4320" ></w:ind>
93 <w:lvl w:ilvl="6" w:tplc="0409000F" >
94 <w:start w:val="1" ></w:start>
95 <w:lvlText w:val="%7." ></w:lvlText>
96 <w:lvlJc w:val="left" ></w:lvlJc>
99 <w:tab w:val="list" w:pos="5040" ></w:tab>
101 <w:ind w:hanging="360" w:left="5040" ></w:ind>
104 <w:lvl w:ilvl="7" w:tplc="04090019" >
105 <w:start w:val="1" ></w:start>
106 <w:nfc w:val="4" ></w:nfc>
107 <w:lvlText w:val="%8." ></w:lvlText>
108 <w:lvlJc w:val="left" ></w:lvlJc>
111 <w:tab w:val="list" w:pos="5760" ></w:tab>
113 <w:ind w:hanging="360" w:left="5760" ></w:ind>
116 <w:lvl w:ilvl="8" w:tentative="on" w:tplc="0409001B" >
117 <w:start w:val="1" ></w:start>
118 <w:nfc w:val="2" ></w:nfc>
119 <w:lvlText w:val="%9." ></w:lvlText>
120 <w:lvlJc w:val="right" ></w:lvlJc>
123 <w:tab w:val="list" w:pos="6480" ></w:tab>
125 <w:ind w:hanging="180" w:left="6480" ></w:ind>
129 <w:listDef w:listDefId="1" >
130 <w:plt w:val="HybridMultilevel" ></w:plt>
131 <w:tmpl w:val="6DBC60EA" ></w:tmpl>
132 <w:lvl w:ilvl="0" w:tplc="04090001" >
133 <w:start w:val="1" ></w:start>
134 <w:nfc w:val="23" ></w:nfc>
135 <w:lvlText w:val="" ></w:lvlText>
136 <w:lvlJc w:val="left" ></w:lvlJc>
139 <w:tab w:val="list" w:pos="720" ></w:tab>
141 <w:ind w:hanging="360" w:left="720" ></w:ind>
144 <w:rFonts w:h-ansi="Symbol" w:hint="default" w:ascii="Symbol" ></w:rFonts>
147 <w:lvl w:ilvl="1" w:tplc="04090003" >
148 <w:start w:val="1" ></w:start>
149 <w:nfc w:val="23" ></w:nfc>
150 <w:lvlText w:val="o" ></w:lvlText>
151 <w:lvlJc w:val="left" ></w:lvlJc>
154 <w:tab w:val="list" w:pos="1440" ></w:tab>
156 <w:ind w:hanging="360" w:left="1440" ></w:ind>
159 <w:rFonts w:h-ansi="Courier New" w:cs="Courier New" w:hint="default" w:ascii="Courier New" ></w:rFonts>
162 <w:lvl w:ilvl="2" w:tplc="04090005" >
163 <w:start w:val="1" ></w:start>
164 <w:nfc w:val="23" ></w:nfc>
165 <w:lvlText w:val="" ></w:lvlText>
166 <w:lvlJc w:val="left" ></w:lvlJc>
169 <w:tab w:val="list" w:pos="2160" ></w:tab>
171 <w:ind w:hanging="360" w:left="2160" ></w:ind>
174 <w:rFonts w:h-ansi="Wingdings" w:hint="default" w:ascii="Wingdings" ></w:rFonts>
177 <w:lvl w:ilvl="3" w:tplc="04090001" >
178 <w:start w:val="1" ></w:start>
179 <w:nfc w:val="23" ></w:nfc>
180 <w:lvlText w:val="" ></w:lvlText>
181 <w:lvlJc w:val="left" ></w:lvlJc>
184 <w:tab w:val="list" w:pos="2880" ></w:tab>
186 <w:ind w:hanging="360" w:left="2880" ></w:ind>
189 <w:rFonts w:h-ansi="Symbol" w:hint="default" w:ascii="Symbol" ></w:rFonts>
192 <w:lvl w:ilvl="4" w:tplc="04090003" >
193 <w:start w:val="1" ></w:start>
194 <w:nfc w:val="23" ></w:nfc>
195 <w:lvlText w:val="o" ></w:lvlText>
196 <w:lvlJc w:val="left" ></w:lvlJc>
199 <w:tab w:val="list" w:pos="3600" ></w:tab>
201 <w:ind w:hanging="360" w:left="3600" ></w:ind>
204 <w:rFonts w:h-ansi="Courier New" w:cs="Courier New" w:hint="default" w:ascii="Courier New" ></w:rFonts>
207 <w:lvl w:ilvl="5" w:tplc="04090005" >
208 <w:start w:val="1" ></w:start>
209 <w:nfc w:val="23" ></w:nfc>
210 <w:lvlText w:val="" ></w:lvlText>
211 <w:lvlJc w:val="left" ></w:lvlJc>
214 <w:tab w:val="list" w:pos="4320" ></w:tab>
216 <w:ind w:hanging="360" w:left="4320" ></w:ind>
219 <w:rFonts w:h-ansi="Wingdings" w:hint="default" w:ascii="Wingdings" ></w:rFonts>
222 <w:lvl w:ilvl="6" w:tplc="04090001" >
223 <w:start w:val="1" ></w:start>
224 <w:nfc w:val="23" ></w:nfc>
225 <w:lvlText w:val="" ></w:lvlText>
226 <w:lvlJc w:val="left" ></w:lvlJc>
229 <w:tab w:val="list" w:pos="5040" ></w:tab>
231 <w:ind w:hanging="360" w:left="5040" ></w:ind>
234 <w:rFonts w:h-ansi="Symbol" w:hint="default" w:ascii="Symbol" ></w:rFonts>
237 <w:lvl w:ilvl="7" w:tplc="04090003" >
238 <w:start w:val="1" ></w:start>
239 <w:nfc w:val="23" ></w:nfc>
240 <w:lvlText w:val="o" ></w:lvlText>
241 <w:lvlJc w:val="left" ></w:lvlJc>
244 <w:tab w:val="list" w:pos="5760" ></w:tab>
246 <w:ind w:hanging="360" w:left="5760" ></w:ind>
249 <w:rFonts w:h-ansi="Courier New" w:cs="Courier New" w:hint="default" w:ascii="Courier New" ></w:rFonts>
252 <w:lvl w:ilvl="8" w:tplc="04090005" >
253 <w:start w:val="1" ></w:start>
254 <w:nfc w:val="23" ></w:nfc>
255 <w:lvlText w:val="" ></w:lvlText>
256 <w:lvlJc w:val="left" ></w:lvlJc>
259 <w:tab w:val="list" w:pos="6480" ></w:tab>
261 <w:ind w:hanging="360" w:left="6480" ></w:ind>
264 <w:rFonts w:h-ansi="Wingdings" w:hint="default" w:ascii="Wingdings" ></w:rFonts>
272 <w:versionOfBuiltInStylenames w:val="4" ></w:versionOfBuiltInStylenames>
273 <w:latentStyles w:latentStyleCount="156" w:defLockedState="off" ></w:latentStyles>
274 <w:style w:styleId="Normal" w:type="paragraph" w:default="on" >
275 <w:name w:val="Normal" ></w:name>
277 <w:spacing w:after="120" ></w:spacing>
280 <wx:font wx:val="Times New Roman" ></wx:font>
281 <w:sz-cs w:val="24" ></w:sz-cs>
282 <w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA" ></w:lang>
285 <w:style w:styleId="Hyperlink" w:type="character" >
286 <w:name w:val="Hyperlink" ></w:name>
287 <w:basedOn w:val="DefaultParagraphFont" ></w:basedOn>
289 <w:color w:val="0000FF" ></w:color>
290 <w:u w:val="single" ></w:u>
293 <w:style w:styleId="LiteralBlock" w:type="paragraph" >
294 <w:name w:val="LiteralBlock" ></w:name>
295 <w:basedOn w:val="Normal" ></w:basedOn>
296 <w:next w:val="Normal" ></w:next>
298 <w:pStyle w:val="LiteralBlock" ></w:pStyle>
299 <w:ind w:right="720" w:left="720" ></w:ind>
302 <w:rFonts w:h-ansi="Courier New" w:ascii="Courier New" ></w:rFonts>
303 <wx:font wx:val="Courier New" ></wx:font><w:sz w:val="20" ></w:sz>
306 <w:style w:styleId="Heading1" w:type="paragraph" >
307 <w:name w:val="heading 1" ></w:name>
308 <wx:uiName wx:val="Heading 1" ></wx:uiName>
309 <w:basedOn w:val="Normal" ></w:basedOn>
310 <w:next w:val="Normal" ></w:next>
312 <w:pStyle w:val="Heading1" ></w:pStyle>
313 <w:keepNext ></w:keepNext>
314 <w:spacing w:before="240" w:after="60" ></w:spacing>
315 <w:outlineLvl w:val="0" ></w:outlineLvl>
318 <w:rFonts w:h-ansi="Arial" w:cs="Arial" w:ascii="Arial" ></w:rFonts>
319 <wx:font wx:val="Arial" ></wx:font>
322 <w:kern w:val="32" ></w:kern>
323 <w:sz w:val="32" ></w:sz>
324 <w:sz-cs w:val="32" ></w:sz-cs>
327 <w:style w:styleId="Heading2" w:type="paragraph" >
328 <w:name w:val="heading 2" ></w:name>
329 <wx:uiName wx:val="Heading 2" ></wx:uiName>
330 <w:basedOn w:val="Normal" ></w:basedOn>
331 <w:next w:val="Normal" ></w:next>
333 <w:pStyle w:val="Heading2" ></w:pStyle>
334 <w:keepNext ></w:keepNext>
335 <w:spacing w:before="240" w:after="60" ></w:spacing>
336 <w:outlineLvl w:val="1" ></w:outlineLvl>
339 <w:rFonts w:h-ansi="Arial" w:cs="Arial" w:ascii="Arial" ></w:rFonts>
340 <wx:font wx:val="Arial" ></wx:font>
345 <w:sz w:val="28" ></w:sz>
346 <w:sz-cs w:val="28" ></w:sz-cs>
349 <w:style w:styleId="Heading3" w:type="paragraph" >
350 <w:name w:val="heading 3" ></w:name>
351 <wx:uiName wx:val="Heading 3" ></wx:uiName>
352 <w:basedOn w:val="Normal" ></w:basedOn>
353 <w:next w:val="Normal" ></w:next>
355 <w:pStyle w:val="Heading3" ></w:pStyle>
356 <w:keepNext ></w:keepNext>
357 <w:spacing w:before="240" w:after="60" ></w:spacing>
358 <w:outlineLvl w:val="2" ></w:outlineLvl>
361 <w:rFonts w:h-ansi="Arial" w:cs="Arial" w:ascii="Arial" ></w:rFonts>
362 <wx:font wx:val="Arial" ></wx:font>
365 <w:sz w:val="26" ></w:sz>
366 <w:sz-cs w:val="26" ></w:sz-cs>
369 <w:style w:styleId="DefaultParagraphFont" w:type="character" w:default="on" >
370 <w:name w:val="Default Paragraph Font" ></w:name>
371 <w:semiHidden ></w:semiHidden>
373 <w:style w:styleId="TableNormal" w:type="table" w:default="on" >
374 <w:name w:val="Normal Table" ></w:name>
375 <wx:uiName wx:val="Table Normal" ></wx:uiName>
376 <w:semiHidden ></w:semiHidden>
378 <wx:font wx:val="Times New Roman" ></wx:font>
381 <w:tblInd w:w="0" w:type="dxa" ></w:tblInd>
383 <w:top w:w="0" w:type="dxa" ></w:top>
384 <w:left w:w="108" w:type="dxa" ></w:left>
385 <w:bottom w:w="0" w:type="dxa" ></w:bottom>
386 <w:right w:w="108" w:type="dxa" ></w:right>
390 <w:style w:styleId="NoList" w:type="list" w:default="on" >
391 <w:name w:val="No List" ></w:name>
392 <w:semiHidden ></w:semiHidden>
394 <w:style w:styleId="Literal" w:type="character" >
395 <w:name w:val="Literal" ></w:name>
396 <w:basedOn w:val="DefaultParagraphFont" ></w:basedOn>
398 <w:rFonts w:h-ansi="Courier New" w:ascii="Courier New" ></w:rFonts>
401 <w:style w:styleId="EndnoteText" w:type="paragraph" >
402 <w:name w:val="endnote text" ></w:name>
403 <wx:uiName wx:val="Endnote Text" ></wx:uiName>
404 <w:basedOn w:val="Normal" ></w:basedOn>
405 <w:semiHidden ></w:semiHidden>
407 <w:pStyle w:val="EndnoteText" ></w:pStyle>
410 <wx:font wx:val="Times New Roman" ></wx:font>
411 <w:sz w:val="20" ></w:sz>
412 <w:sz-cs w:val="20" ></w:sz-cs>
415 <w:style w:styleId="EndnoteReference" w:type="character" >
416 <w:name w:val="endnote reference" ></w:name>
417 <wx:uiName wx:val="Endnote Reference" ></wx:uiName>
418 <w:basedOn w:val="DefaultParagraphFont" ></w:basedOn>
419 <w:semiHidden ></w:semiHidden>
421 <w:vertAlign w:val="superscript" ></w:vertAlign>
424 <w:style w:styleId="AuthorName" w:type="paragraph" >
425 <w:name w:val="AuthorName" ></w:name>
426 <w:basedOn w:val="Normal" ></w:basedOn>
427 <w:next w:val="Normal" ></w:next>
429 <w:pStyle w:val="AuthorName" ></w:pStyle>
430 <w:spacing w:before="240" w:after="240" ></w:spacing>
431 <w:jc w:val="center" ></w:jc>
437 <w:style w:styleId="AuthorContact" w:type="paragraph" >
438 <w:name w:val="AuthorContact" ></w:name>
439 <w:basedOn w:val="Normal" ></w:basedOn>
440 <w:next w:val="Normal" ></w:next>
442 <w:pStyle w:val="AuthorContact" ></w:pStyle>
443 <w:spacing w:before="240" w:after="240" ></w:spacing>
444 <w:jc w:val="center" ></w:jc>
447 <wx:font wx:val="Times New Roman" ></wx:font>
451 <w:style w:styleId="BibliographMatter" w:type="paragraph" >
452 <w:name w:val="BibliographMatter" ></w:name>
453 <w:basedOn w:val="Normal" ></w:basedOn>
454 <w:next w:val="Normal" ></w:next>
456 <w:pStyle w:val="BibliographMatter" ></w:pStyle>
457 <w:spacing w:before="240" w:after="240" ></w:spacing>
458 <w:jc w:val="center" ></w:jc>
464 <w:style w:styleId="DefinitionTerm" w:type="paragraph" >
465 <w:name w:val="DefinitionTerm" ></w:name>
466 <w:basedOn w:val="Normal" ></w:basedOn>
467 <w:next w:val="Normal" ></w:next>
469 <w:pStyle w:val="DefinitionTerm" ></w:pStyle>
475 <w:style w:styleId="Definition" w:type="paragraph" >
476 <w:name w:val="Definition" ></w:name>
477 <w:basedOn w:val="Normal" ></w:basedOn>
478 <w:next w:val="Normal" ></w:next>
480 <w:pStyle w:val="Definition" ></w:pStyle>
483 <w:style w:styleId="CitationReference" w:type="character" >
484 <w:name w:val="CitationReference" ></w:name>
485 <w:basedOn w:val="DefaultParagraphFont" ></w:basedOn>
487 <w:style w:styleId="Topic" w:type="paragraph" >
488 <w:name w:val="Topic" ></w:name>
489 <w:basedOn w:val="Normal" ></w:basedOn>
490 <w:next w:val="Normal" ></w:next>
492 <w:pStyle w:val="Topic" ></w:pStyle>
493 <w:ind w:right="1440" w:left="1440" ></w:ind>
494 <w:jc w:val="both" ></w:jc>
499 <w:view w:val="print" ></w:view>
500 <w:zoom w:percent="100" ></w:zoom>
501 <w:doNotEmbedSystemFonts ></w:doNotEmbedSystemFonts>
502 <w:proofState w:grammar="clean" w:spelling="clean" ></w:proofState>
503 <w:attachedTemplate w:val="" ></w:attachedTemplate>
504 <w:defaultTabStop w:val="720" ></w:defaultTabStop>
505 <w:punctuationKerning ></w:punctuationKerning>
506 <w:characterSpacingControl w:val="DontCompress" ></w:characterSpacingControl>
507 <w:optimizeForBrowser ></w:optimizeForBrowser>
508 <w:validateAgainstSchema ></w:validateAgainstSchema>
509 <w:saveInvalidXML w:val="off" ></w:saveInvalidXML>
510 <w:ignoreMixedContent w:val="off" ></w:ignoreMixedContent>
511 <w:alwaysShowPlaceholderText w:val="off" ></w:alwaysShowPlaceholderText>
513 <w:breakWrappedTables ></w:breakWrappedTables>
514 <w:snapToGridInCell ></w:snapToGridInCell>
515 <w:wrapTextWithPunct ></w:wrapTextWithPunct>
516 <w:useAsianBreakRules ></w:useAsianBreakRules>
517 <w:useWord2002TableStyleRules ></w:useWord2002TableStyleRules>
520 <w:footnote w:type="separator" >
523 <w:separator ></w:separator>
527 <w:footnote w:type="continuation-separator" >
530 <w:continuationSeparator ></w:continuationSeparator>
536 <w:numFmt w:val="decimal" ></w:numFmt>
537 <w:endnote w:type="separator" >
540 <w:separator ></w:separator>
544 <w:endnote w:type="continuation-separator" >
547 <w:continuationSeparator ></w:continuationSeparator>
557 <w:t>this is a test.</w:t>
563 <w:numFmt w:val="decimal" ></w:numFmt>
565 <w:pgSz w:w="12240" w:h="15840" ></w:pgSz>
566 <w:pgMar w:header="720" w:gutter="0" w:right="1800" w:top="1440" w:bottom="1440" w:footer="720" w:left="1800" ></w:pgMar>
567 <w:cols w:space="720" ></w:cols>
568 <w:docGrid w:line-pitch="360" ></w:docGrid>
575 from docutils
import core
, io
577 def test_wordml( input_string
):
578 overrides
= { 'template' : '../template.xml' }
579 parts
= core
.publish_string( input_string
, writer_name
='docutils_wordml', settings_overrides
=overrides
)
586 if __name__
== "__main__":