1 Star 0 Fork 1

青大叔 / gooxml

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CT_CustomXmlBlock.go 22.09 KB
一键复制 编辑 原始数据 按行查看 历史
qwj 提交于 2021-09-03 14:09 . 修改包名
// Copyright 2017 Baliance. All rights reserved.
//
// DO NOT EDIT: generated by gooxml ECMA-376 generator
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package wml
import (
"encoding/xml"
"fmt"
"gitee.com/jiewen/gooxml"
"gitee.com/jiewen/gooxml/schema/soo/ofc/math"
)
type CT_CustomXmlBlock struct {
// Custom XML Element Namespace
UriAttr *string
// Custom XML Element Name
ElementAttr string
// Custom XML Element Properties
CustomXmlPr *CT_CustomXmlPr
EG_ContentBlockContent []*EG_ContentBlockContent
}
func NewCT_CustomXmlBlock() *CT_CustomXmlBlock {
ret := &CT_CustomXmlBlock{}
return ret
}
func (m *CT_CustomXmlBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if m.UriAttr != nil {
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"},
Value: fmt.Sprintf("%v", *m.UriAttr)})
}
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"},
Value: fmt.Sprintf("%v", m.ElementAttr)})
e.EncodeToken(start)
if m.CustomXmlPr != nil {
secustomXmlPr := xml.StartElement{Name: xml.Name{Local: "w:customXmlPr"}}
e.EncodeElement(m.CustomXmlPr, secustomXmlPr)
}
if m.EG_ContentBlockContent != nil {
for _, c := range m.EG_ContentBlockContent {
c.MarshalXML(e, xml.StartElement{})
}
}
e.EncodeToken(xml.EndElement{Name: start.Name})
return nil
}
func (m *CT_CustomXmlBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
for _, attr := range start.Attr {
if attr.Name.Local == "uri" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.UriAttr = &parsed
continue
}
if attr.Name.Local == "element" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.ElementAttr = parsed
continue
}
}
lCT_CustomXmlBlock:
for {
tok, err := d.Token()
if err != nil {
return err
}
switch el := tok.(type) {
case xml.StartElement:
switch el.Name {
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlPr"}:
m.CustomXmlPr = NewCT_CustomXmlPr()
if err := d.DecodeElement(m.CustomXmlPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock()
if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmpcontentblockcontent.Sdt = NewCT_SdtBlock()
if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmp := NewCT_P()
if err := d.DecodeElement(tmp, &el); err != nil {
return err
}
tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp)
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmp := NewCT_Tbl()
if err := d.DecodeElement(tmp, &el); err != nil {
return err
}
tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp)
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.ProofErr = NewCT_ProofErr()
if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.PermStart = NewCT_PermStart()
if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.PermEnd = NewCT_Perm()
if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.Ins = NewCT_RunTrackChange()
if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.Del = NewCT_RunTrackChange()
if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.MoveFrom = NewCT_RunTrackChange()
if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprunlevelelts.MoveTo = NewCT_RunTrackChange()
if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.BookmarkStart = NewCT_Bookmark()
if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange()
if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark()
if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange()
if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark()
if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange()
if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange()
if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange()
if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmprangemarkupelements := NewEG_RangeMarkupElements()
tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup()
if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements)
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmpmathcontent := NewEG_MathContent()
tmpmathcontent.OMathPara = math.NewOMathPara()
if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent)
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}:
tmpcontentblockcontent := NewEG_ContentBlockContent()
tmprunlevelelts := NewEG_RunLevelElts()
tmpmathcontent := NewEG_MathContent()
tmpmathcontent.OMath = math.NewOMath()
if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil {
return err
}
m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent)
tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts)
tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent)
default:
gooxml.Log("skipping unsupported element on CT_CustomXmlBlock %v", el.Name)
if err := d.Skip(); err != nil {
return err
}
}
case xml.EndElement:
break lCT_CustomXmlBlock
case xml.CharData:
}
}
return nil
}
// Validate validates the CT_CustomXmlBlock and its children
func (m *CT_CustomXmlBlock) Validate() error {
return m.ValidateWithPath("CT_CustomXmlBlock")
}
// ValidateWithPath validates the CT_CustomXmlBlock and its children, prefixing error messages with path
func (m *CT_CustomXmlBlock) ValidateWithPath(path string) error {
if m.CustomXmlPr != nil {
if err := m.CustomXmlPr.ValidateWithPath(path + "/CustomXmlPr"); err != nil {
return err
}
}
for i, v := range m.EG_ContentBlockContent {
if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil {
return err
}
}
return nil
}
1
https://gitee.com/jiewen/gooxml.git
git@gitee.com:jiewen/gooxml.git
jiewen
gooxml
gooxml
c517a803bade

搜索帮助