yq/pkg/yqlib/xml.go

47 lines
1.1 KiB
Go
Raw Permalink Normal View History

2022-10-25 03:27:16 +00:00
package yqlib
type XmlPreferences struct {
2024-02-24 04:03:30 +00:00
Indent int
2022-10-25 03:27:16 +00:00
AttributePrefix string
ContentName string
StrictMode bool
KeepNamespace bool
UseRawToken bool
ProcInstPrefix string
DirectiveName string
SkipProcInst bool
SkipDirectives bool
}
func NewDefaultXmlPreferences() XmlPreferences {
return XmlPreferences{
2024-02-24 04:03:30 +00:00
Indent: 2,
2022-11-10 11:22:55 +00:00
AttributePrefix: "+@",
2022-10-25 03:27:16 +00:00
ContentName: "+content",
StrictMode: false,
KeepNamespace: true,
UseRawToken: true,
2022-10-25 03:27:16 +00:00
ProcInstPrefix: "+p_",
DirectiveName: "+directive",
SkipProcInst: false,
SkipDirectives: false,
}
}
2024-02-24 04:03:30 +00:00
func (p *XmlPreferences) Copy() XmlPreferences {
return XmlPreferences{
Indent: p.Indent,
AttributePrefix: p.AttributePrefix,
ContentName: p.ContentName,
StrictMode: p.StrictMode,
KeepNamespace: p.KeepNamespace,
UseRawToken: p.UseRawToken,
ProcInstPrefix: p.ProcInstPrefix,
DirectiveName: p.DirectiveName,
SkipProcInst: p.SkipProcInst,
SkipDirectives: p.SkipDirectives,
}
}
2022-10-25 03:27:16 +00:00
var ConfiguredXMLPreferences = NewDefaultXmlPreferences()