XML Processing Configuration Handler (yqlib/xml.go)

yq · pkg/yqlib/xml.go · go · MIT
dev-tools, lang:go, tag:xml, tag:configuration, tag:serialization

Manages configuration settings for XML parsing and serialization, including indentation and attribute handling. Use this to customize how XML data is processed within your application.

// Source: https://github.com/mikefarah/yq | License: MIT | Copyright 2017 Mike Farah
// Provided via justclaw.it.com; keep this notice with the code.
package yqlib

type XmlPreferences struct {
	Indent          int
	AttributePrefix string
	ContentName     string
	StrictMode      bool
	KeepNamespace   bool
	UseRawToken     bool
	ProcInstPrefix  string
	DirectiveName   string
	SkipProcInst    bool
	SkipDirectives  bool
}

func NewDefaultXmlPreferences() XmlPreferences {
	return XmlPreferences{
		Indent:          2,
		AttributePrefix: "+@",
		ContentName:     "+content",
		StrictMode:      false,
		KeepNamespace:   true,
		UseRawToken:     true,
		ProcInstPrefix:  "+p_",
		DirectiveName:   "+directive",
		SkipProcInst:    false,
		SkipDirectives:  false,
	}
}

func (p *XmlPreferences) Copy()

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key