88
99// This element specifies the contents of the body of the document – the main document editing surface.
1010type Body struct {
11- Root * RootDoc
11+ root * RootDoc
1212 XMLName xml.Name `xml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main body"`
1313 Children []DocumentChild
1414 SectPr * ctypes.SectionProp
@@ -23,7 +23,7 @@ type DocumentChild struct {
2323// Use this function to initialize a new Body before adding content to it.
2424func NewBody (root * RootDoc ) * Body {
2525 return & Body {
26- Root : root ,
26+ root : root ,
2727 }
2828}
2929
@@ -40,13 +40,13 @@ func (b Body) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error) {
4040 if b .Children != nil {
4141 for _ , child := range b .Children {
4242 if child .Para != nil {
43- if err = child .Para .CT .MarshalXML (e , xml.StartElement {}); err != nil {
43+ if err = child .Para .ct .MarshalXML (e , xml.StartElement {}); err != nil {
4444 return err
4545 }
4646 }
4747
4848 if child .Table != nil {
49- if err = child .Table .CT .MarshalXML (e , xml.StartElement {}); err != nil {
49+ if err = child .Table .ct .MarshalXML (e , xml.StartElement {}); err != nil {
5050 return err
5151 }
5252 }
@@ -76,14 +76,14 @@ func (body *Body) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err erro
7676 case xml.StartElement :
7777 switch elem .Name .Local {
7878 case "p" :
79- para := NewParagraph (body .Root )
80- if err := d .DecodeElement (& para .CT , & elem ); err != nil {
79+ para := newParagraph (body .root )
80+ if err := d .DecodeElement (& para .ct , & elem ); err != nil {
8181 return err
8282 }
8383 body .Children = append (body .Children , DocumentChild {Para : para })
8484 case "tbl" :
85- tbl := NewTable (body .Root )
86- if err := d .DecodeElement (& tbl .CT , & elem ); err != nil {
85+ tbl := NewTable (body .root )
86+ if err := d .DecodeElement (& tbl .ct , & elem ); err != nil {
8787 return err
8888 }
8989 body .Children = append (body .Children , DocumentChild {Table : tbl })
0 commit comments