oox 0.1.0

Open Office XML file format deserializer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
use super::{paragraphs::TextParagraphProperties, runformatting::TextFont};
use crate::{
    error::{MissingAttributeError, MissingChildNodeError, NotGroupMemberError},
    shared::drawingml::{
        colors::Color,
        shapeprops::Blip,
        simpletypes::{TextAutonumberScheme, TextBulletSizePercent, TextBulletStartAtNum, TextFontSize},
    },
    xml::XmlNode,
    xsdtypes::{XsdChoice, XsdType},
};
use std::error::Error;

pub type Result<T> = ::std::result::Result<T, Box<dyn Error>>;

#[derive(Debug, Clone, PartialEq)]
pub enum TextBulletColor {
    /// This element specifies that the color of the bullets for a paragraph should be of the same color as the text run
    /// within which each bullet is contained.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///     <a:buClrTx>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The color of the above bullet follows the default text color of the text for the run of text shown above since no
    /// specific text color was specified.
    FollowText,

    /// This element specifies the color to be used on bullet characters within a given paragraph. The color is specified
    /// using the numerical RGB color format.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buClr>
    ///         <a:srgbClr val="FFFF00"/>
    ///       </a:buClr>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The color of the above bullet does not follow the text color but instead has a yellow color specified by
    /// val="FFFF00". This color should only apply to the actual bullet character and not to the text within the bullet.
    Color(Color),
}

impl XsdType for TextBulletColor {
    fn from_xml_element(xml_node: &XmlNode) -> Result<TextBulletColor> {
        match xml_node.local_name() {
            "buClrTx" => Ok(TextBulletColor::FollowText),
            "buClr" => {
                let color = xml_node
                    .child_nodes
                    .iter()
                    .find_map(Color::try_from_xml_element)
                    .transpose()?
                    .ok_or_else(|| MissingChildNodeError::new(xml_node.name.clone(), "color"))?;

                Ok(TextBulletColor::Color(color))
            }
            _ => Err(NotGroupMemberError::new(xml_node.name.clone(), "EG_TextBulletColor").into()),
        }
    }
}

impl XsdChoice for TextBulletColor {
    fn is_choice_member<T: AsRef<str>>(name: T) -> bool {
        match name.as_ref() {
            "buClrTx" | "buClr" => true,
            _ => false,
        }
    }
}

#[derive(Debug, Clone, PartialEq)]
pub enum TextBulletSize {
    /// This element specifies that the size of the bullets for a paragraph should be of the same point size as the text run
    /// within which each bullet is contained.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buSzTx>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The size of the above bullet follows the default text size of the text for the run of text shown above since no
    /// specific text size was specified.
    FollowText,

    /// This element specifies the size in percentage of the surrounding text to be used on bullet characters within a
    /// given paragraph.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buSzPct val="111%"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The size of the above bullet follows the text size in that it is always rendered at 111% the size of the text within
    /// the given text run. This is specified by val="111%", with a restriction on the values not being less than 25% or
    /// more than 400%. This percentage size should only apply to the actual bullet character and not to the text within
    /// the bullet.
    Percent(TextBulletSizePercent),

    /// This element specifies the size in points to be used on bullet characters within a given paragraph. The size is
    /// specified using the points where 100 is equal to 1 point font and 1200 is equal to 12 point font.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buSzPts val="1400"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The size of the above bullet does not follow the text size of the text within the given text run. The bullets size is
    /// specified by val="1400", which corresponds to a point size of 14. This bullet size should only apply to the actual
    /// bullet character and not to the text within the bullet.
    Point(TextFontSize),
}

impl XsdType for TextBulletSize {
    fn from_xml_element(xml_node: &XmlNode) -> Result<TextBulletSize> {
        match xml_node.local_name() {
            "buSzTx" => Ok(TextBulletSize::FollowText),
            "buSzPct" => {
                let val = xml_node
                    .attributes
                    .get("val")
                    .ok_or_else(|| MissingAttributeError::new(xml_node.name.clone(), "val"))?
                    .parse()?;

                Ok(TextBulletSize::Percent(val))
            }
            "buSzPts" => {
                let val = xml_node
                    .attributes
                    .get("val")
                    .ok_or_else(|| MissingAttributeError::new(xml_node.name.clone(), "val"))?
                    .parse()?;

                Ok(TextBulletSize::Point(val))
            }
            _ => Err(NotGroupMemberError::new(xml_node.name.clone(), "EG_TextBulletSize").into()),
        }
    }
}

impl XsdChoice for TextBulletSize {
    fn is_choice_member<T: AsRef<str>>(name: T) -> bool {
        match name.as_ref() {
            "buSzTx" | "buSzPct" | "buSzPts" => true,
            _ => false,
        }
    }
}

#[derive(Debug, Clone, PartialEq)]
pub enum TextBulletTypeface {
    /// This element specifies that the font of the bullets for a paragraph should be of the same font as the text run
    /// within which each bullet is contained.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buFontTx>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The font of the above bullet follows the default text font of the text for the run of text shown above since no
    /// specific text font was specified.
    FollowText,

    /// This element specifies the font to be used on bullet characters within a given paragraph. The font is specified
    /// using the typeface that it is registered as within the generating application.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buFont typeface="Arial"/>
    ///       <a:buChar char="g"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The font of the above bullet does not follow the text font but instead has Arial font specified by
    /// typeface="Arial". This font should only apply to the actual bullet character and not to the text within the bullet.
    Font(TextFont),
}

impl XsdType for TextBulletTypeface {
    fn from_xml_element(xml_node: &XmlNode) -> Result<TextBulletTypeface> {
        match xml_node.local_name() {
            "buFontTx" => Ok(TextBulletTypeface::FollowText),
            "buFont" => Ok(TextBulletTypeface::Font(TextFont::from_xml_element(xml_node)?)),
            _ => Err(NotGroupMemberError::new(xml_node.name.clone(), "EG_TextBulletTypeface").into()),
        }
    }
}

impl XsdChoice for TextBulletTypeface {
    fn is_choice_member<T: AsRef<str>>(name: T) -> bool {
        match name.as_ref() {
            "buFontTx" | "buFont" => true,
            _ => false,
        }
    }
}

#[derive(Debug, Clone, PartialEq)]
pub enum TextBullet {
    /// This element specifies that the paragraph within which it is applied is to have no bullet formatting applied to it.
    /// That is to say that there should be no bulleting found within the paragraph where this element is specified.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buNone/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// The above paragraph is formatted with no bullets.
    None,

    /// This element specifies that automatic numbered bullet points should be applied to a paragraph. These are not
    /// just numbers used as bullet points but instead automatically assigned numbers that are based on both
    /// buAutoNum attributes and paragraph level.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buAutoNum type="arabicPeriod"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr lvl="1"…>
    ///       <a:buAutoNum type="arabicPeriod"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 2</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buAutoNum type="arabicPeriod"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 3</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// For the above text there are a total of three bullet points. Two of which are at lvl="0" and one at lvl="1". Due to
    /// this breakdown of levels, the numbering sequence that should be automatically applied is 1, 1, 2 as is shown in
    /// the picture above.
    AutoNumbered(TextAutonumberedBullet),

    /// This element specifies that a character be applied to a set of bullets. These bullets are allowed to be any
    /// character in any font that the system is able to support. If no bullet font is specified along with this element then
    /// the paragraph font is used.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buFont typeface="Calibri"/>
    ///       <a:buChar char="g"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr lvl="1"…>
    ///       <a:buFont typeface="Calibri"/>
    ///       <a:buChar char="g"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 2</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buFont typeface="Calibri"/>
    ///       <a:buChar char="g"/>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 3</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// For the above text there are a total of three bullet points. Two of which are at lvl="0" and one at lvl="1".
    /// Because the same character is specified for each bullet the levels do not stand out here. The only difference is
    /// the indentation as shown in the picture above.
    Character(String),

    /// This element specifies that a picture be applied to a set of bullets. This element allows for any standard picture
    /// format graphic to be used instead of the typical bullet characters. This opens up the possibility for bullets to be
    /// anything the generating application would seek to apply.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buBlip>
    ///         <a:blip r:embed="rId2"/>
    ///       </a:buBlip>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 1</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr lvl="1"…>
    ///       <a:buBlip>
    ///         <a:blip r:embed="rId2"/>
    ///       </a:buBlip>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 2</a:t>
    ///    ///   </a:p>
    ///   <a:p>
    ///     <a:pPr …>
    ///       <a:buBlip>
    ///         <a:blip r:embed="rId2"/>
    ///       </a:buBlip>
    ///     </a:pPr>
    ///    ///     <a:t>Bullet 3</a:t>
    ///    ///   </a:p>
    ///    /// </p:txBody>
    /// ```
    ///
    /// For the above text there are a total of three bullet points. Two of which are at lvl="0" and one at lvl="1".
    /// Because the same picture is specified for each bullet the levels do not stand out here. The only difference is the
    /// indentation as shown in the picture above.
    Picture(Box<Blip>),
}

impl XsdType for TextBullet {
    fn from_xml_element(xml_node: &XmlNode) -> Result<TextBullet> {
        match xml_node.local_name() {
            "buNone" => Ok(TextBullet::None),
            "buAutoNum" => Ok(TextBullet::AutoNumbered(TextAutonumberedBullet::from_xml_element(
                xml_node,
            )?)),
            "buChar" => {
                let character = xml_node
                    .attributes
                    .get("char")
                    .ok_or_else(|| MissingAttributeError::new(xml_node.name.clone(), "char"))?
                    .clone();

                Ok(TextBullet::Character(character))
            }
            "buBlip" => {
                let blip = xml_node
                    .child_nodes
                    .iter()
                    .find(|child_node| child_node.local_name() == "blip")
                    .ok_or_else(|| {
                        Box::<dyn Error>::from(MissingChildNodeError::new(xml_node.name.clone(), "EG_TextBullet"))
                    })
                    .and_then(Blip::from_xml_element)?;

                Ok(TextBullet::Picture(Box::new(blip)))
            }
            _ => Err(NotGroupMemberError::new(xml_node.name.clone(), "EG_TextBullet").into()),
        }
    }
}

impl XsdChoice for TextBullet {
    fn is_choice_member<T: AsRef<str>>(name: T) -> bool {
        match name.as_ref() {
            "buNone" | "buAutoNum" | "buChar" | "buBlip" => true,
            _ => false,
        }
    }
}

#[derive(Debug, Clone, PartialEq)]
pub struct TextAutonumberedBullet {
    /// Specifies the numbering scheme that is to be used. This allows for the describing of
    /// formats other than strictly numbers. For instance, a set of bullets can be represented by a
    /// series of Roman numerals instead of the standard 1,2,3,etc. number set.
    pub scheme: TextAutonumberScheme,

    /// Specifies the number that starts a given sequence of automatically numbered bullets.
    /// When the numbering is alphabetical, the number should map to the appropriate letter.
    /// For instance 1 maps to 'a', 2 to 'b' and so on. If the numbers are larger than 26, then
    /// multiple letters should be used. For instance 27 should be represented as 'aa' and
    /// similarly 53 should be 'aaa'.
    pub start_at: Option<TextBulletStartAtNum>,
}

impl TextAutonumberedBullet {
    pub fn from_xml_element(xml_node: &XmlNode) -> Result<TextAutonumberedBullet> {
        let mut scheme = None;
        let mut start_at = None;

        for (attr, value) in &xml_node.attributes {
            match attr.as_str() {
                "type" => scheme = Some(value.parse()?),
                "startAt" => start_at = Some(value.parse()?),
                _ => (),
            }
        }

        let scheme = scheme.ok_or_else(|| MissingAttributeError::new(xml_node.name.clone(), "type"))?;

        Ok(Self { scheme, start_at })
    }
}

/// This element specifies the list of styles associated with this body of text.
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TextListStyle {
    /// This element specifies the paragraph properties that are to be applied when no other paragraph properties have
    /// been specified. If this attribute is omitted, then it is left to the application to decide the set of default paragraph
    /// properties that should be applied.
    ///
    /// # Xml example
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:lstStyle>
    ///     <a:defPPr>
    ///       <a:buNone/>
    ///     </a:defPPr>
    ///   </a:lstStyle>
    ///   <a:p>
    ///    ///     <a:t>Sample Text</a:t>
    ///    ///   </a:p>
    /// </p:txBody>
    /// ```
    ///
    /// The above paragraph follows the properties described in defPPr if no overriding properties are specified within
    /// the pPr element.
    pub def_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="0". There
    /// are a total of 9 level text property elements allowed, levels 0-8. It is recommended that the order in which this
    /// and other level property elements are specified be in order of increasing level. That is lvl2pPr should come
    /// before lvl3pPr. This allows the lower level properties to take precedence over the higher level ones because
    /// they are parsed first
    ///
    /// # Xml example
    ///
    /// Consider the following DrawingML code that would specify a paragraph to follow the level style
    /// defined in lvl1pPr and thus create a paragraph of text that has no bullets and is right aligned.
    ///
    /// ```xml
    /// <p:txBody>
    ///    ///   <a:lstStyle>
    ///     <a:lvl1pPr algn="r">
    ///       <a:buNone/>
    ///     </a:lvl1pPr>
    ///   </a:lstStyle>
    ///   <a:p>
    ///     <a:pPr lvl="0">
    ///     </a:pPr>
    ///    ///     <a:t>Some text</a:t>
    ///    ///   </a:p>
    /// </p:txBody>
    /// ```
    ///
    /// # Note
    ///
    /// To resolve conflicting paragraph properties the linear hierarchy of paragraph properties should be
    /// examined starting first with the pPr element. The rule here is that properties that are defined at a level closer to
    /// the actual text should take precedence. That is if there is a conflicting property between the pPr and lvl1pPr
    /// elements then the pPr property should take precedence because in the property hierarchy it is closer to the
    /// actual text being represented.
    pub lvl1_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="1".
    pub lvl2_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="2".
    pub lvl3_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="3".
    pub lvl4_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="4".
    pub lvl5_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="5".
    pub lvl6_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="6".
    pub lvl7_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="7".
    pub lvl8_paragraph_props: Option<Box<TextParagraphProperties>>,

    /// This element specifies all paragraph level text properties for all elements that have the attribute lvl="8".
    pub lvl9_paragraph_props: Option<Box<TextParagraphProperties>>,
}

impl TextListStyle {
    pub fn from_xml_element(xml_node: &XmlNode) -> Result<Self> {
        xml_node
            .child_nodes
            .iter()
            .try_fold(Default::default(), |mut instance: Self, child_node| {
                match child_node.local_name() {
                    "defPPr" => {
                        instance.def_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl1pPr" => {
                        instance.lvl1_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl2pPr" => {
                        instance.lvl2_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl3pPr" => {
                        instance.lvl3_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl4pPr" => {
                        instance.lvl4_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl5pPr" => {
                        instance.lvl5_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl6pPr" => {
                        instance.lvl6_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl7pPr" => {
                        instance.lvl7_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl8pPr" => {
                        instance.lvl8_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    "lvl9pPr" => {
                        instance.lvl9_paragraph_props =
                            Some(Box::new(TextParagraphProperties::from_xml_element(child_node)?))
                    }
                    _ => (),
                }

                Ok(instance)
            })
    }
}