feat(参照标准): 规范资源处理,完善版本编辑
build.yaml / build (push) Successful in 42s

This commit is contained in:
xiaoqidun committed 2026-10-10 20:43:06 +08:00
1 parent 53769b65ab
commit 492adccb81
35 files changed
+1182 -239

No files matched your search

+18
View File
@@ -34,6 +34,24 @@ type DocBody struct {
DocInfo DocInfo `xml:"DocInfo"`
DocRoot string `xml:"DocRoot"`
Signatures string `xml:"Signatures"`
versioned bool
}
// UnmarshalXML 读取文档入口并记录版本列表是否存在,版本描述在选择时读取
// 入参: decoder XML解码器, start 起始节点
// 返回: error 解析错误
func (body *DocBody) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error {
type docBody DocBody
var value struct {
docBody
Versions *struct{} `xml:"Versions"`
}
if err := decoder.DecodeElement(&value, &start); err != nil {
return err
}
*body = DocBody(value.docBody)
body.versioned = value.Versions != nil
return nil
}
// DocInfo 文档元数据