Documentation
¶
Index ¶
- Variables
- func DisableIndent(e *xml.Encoder)
- func EnableIndent(e *xml.Encoder)
- func Marshal(t interface{}) ([]byte, error)
- func MarshalXml(o any, e *xml.Encoder, start xml.StartElement) error
- func SelfClosing(b []byte) []byte
- func SelfClosingNamed(b []byte, names []string) []byte
- func SelfClosingWithAttributes(b []byte) []byte
- func TrimSuffixToEnd(s, suffix string) string
- func WriteToFile(t interface{}, fileName string) error
- type EmptyElementKeeper
- type OpenMetadataFunc
- type SelfClosedElementNamer
Constants ¶
This section is empty.
Variables ¶
View Source
var ConvertNumericXMLEntities = true
View Source
var FormulaEscaper = strings.NewReplacer(
`&`, "&",
`'`, "'",
`<`, "<",
`>`, ">",
`"`, """,
)
View Source
var MarshalWide = false
View Source
var TypeRegistry metadataTypeRegistry
Functions ¶
func DisableIndent ¶
func EnableIndent ¶
func MarshalXml ¶
func SelfClosingNamed ¶ added in v0.69.0
Make empty tags with the given names self-closing
func SelfClosingWithAttributes ¶ added in v0.69.0
Make empty tags that have attributes self-closing
func TrimSuffixToEnd ¶
Trim suffix plus anything that follows it.
func WriteToFile ¶
Types ¶
type EmptyElementKeeper ¶ added in v0.69.0
type EmptyElementKeeper interface {
KeepEmptyElements()
}
EmptyElementKeeper is implemented by metadata types that Salesforce writes with empty elements as <name></name> instead of <name/>. Marshal leaves their empty elements open, except for those with attributes, such as <name xsi:nil="true"/>, which Salesforce still writes self-closed.
type OpenMetadataFunc ¶
type OpenMetadataFunc func(path string) (metadata.RegisterableMetadata, error)
type SelfClosedElementNamer ¶ added in v0.69.0
type SelfClosedElementNamer interface {
SelfClosedElements() []string
}
SelfClosedElementNamer is implemented by an EmptyElementKeeper whose complex elements Salesforce writes self-closed when they have no children, such as a flow's <value/>, while it writes its empty text elements open.
Click to show internal directories.
Click to hide internal directories.