xsd

package
v0.0.0-...-8e20013 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStaticType

func IsStaticType(name string) bool

func ParseXmlnsOverrides

func ParseXmlnsOverrides(overrides []string) (xmlnsOverrides, error)

func StaticType

func StaticType(name string) staticType

Types

type Any

type Any struct {
	XMLName         xml.Name `xml:"http://www.w3.org/2001/XMLSchema any"`
	Namespace       string   `xml:"namespace,attr"`
	MinOccurs       string   `xml:"minOccurs,attr"`
	MaxOccurs       string   `xml:"maxOccurs,attr"`
	ProcessContents string   `xml:"processContents,attr"`
	// contains filtered or unexported fields
}

type Attribute

type Attribute struct {
	XMLName        xml.Name  `xml:"http://www.w3.org/2001/XMLSchema attribute"`
	Name           string    `xml:"name,attr"`
	Type           reference `xml:"type,attr"`
	Use            string    `xml:"use,attr"`
	DuplicateCount uint      `xml:"-"`
	Ref            reference `xml:"ref,attr"`
	// contains filtered or unexported fields
}

Attribute defines single XML attribute

func (*Attribute) GoForeignModule

func (a *Attribute) GoForeignModule() string

func (*Attribute) GoName

func (a *Attribute) GoName() string

Public Go Name of this struct item

func (*Attribute) GoType

func (a *Attribute) GoType() string

func (*Attribute) Modifiers

func (a *Attribute) Modifiers() string

func (*Attribute) XmlName

func (a *Attribute) XmlName() string

type AttributeGroup

type AttributeGroup struct {
	XMLName          xml.Name    `xml:"http://www.w3.org/2001/XMLSchema attributeGroup"`
	Name             string      `xml:"name,attr"`
	Ref              reference   `xml:"ref,attr"`
	AttributesDirect []Attribute `xml:"attribute"`
	// contains filtered or unexported fields
}

func (*AttributeGroup) Attributes

func (att *AttributeGroup) Attributes() []Attribute

func (*AttributeGroup) ContainsText

func (att *AttributeGroup) ContainsText() bool

func (*AttributeGroup) Elements

func (att *AttributeGroup) Elements() []Element

func (*AttributeGroup) GoName

func (att *AttributeGroup) GoName() string

func (*AttributeGroup) GoTypeName

func (att *AttributeGroup) GoTypeName() string

func (*AttributeGroup) Schema

func (att *AttributeGroup) Schema() *Schema

type Choice

type Choice struct {
	XMLName     xml.Name   `xml:"http://www.w3.org/2001/XMLSchema choice"`
	MinOccurs   string     `xml:"minOccurs,attr"`
	MaxOccurs   string     `xml:"maxOccurs,attr"`
	ElementList []Element  `xml:"element"`
	Sequences   []Sequence `xml:"sequence"`
	// contains filtered or unexported fields
}

func (*Choice) Elements

func (c *Choice) Elements() []Element

type ComplexContent

type ComplexContent struct {
	XMLName     xml.Name     `xml:"http://www.w3.org/2001/XMLSchema complexContent"`
	Extension   *Extension   `xml:"extension"`
	Restriction *Restriction `xml:"restriction"`
	// contains filtered or unexported fields
}

func (*ComplexContent) Attributes

func (cc *ComplexContent) Attributes() []Attribute

func (*ComplexContent) ContainsText

func (cc *ComplexContent) ContainsText() bool

func (*ComplexContent) Elements

func (cc *ComplexContent) Elements() []Element

type ComplexType

type ComplexType struct {
	XMLName          xml.Name     `xml:"http://www.w3.org/2001/XMLSchema complexType"`
	Name             string       `xml:"name,attr"`
	Mixed            bool         `xml:"mixed,attr"`
	AttributesDirect []Attribute  `xml:"attribute"`
	Sequence         *Sequence    `xml:"sequence"`
	SequenceAll      *SequenceAll `xml:"all"`

	SimpleContent  *SimpleContent  `xml:"simpleContent"`
	ComplexContent *ComplexContent `xml:"complexContent"`
	Choice         *Choice         `xml:"choice"`
	// contains filtered or unexported fields
}

func (*ComplexType) Attributes

func (ct *ComplexType) Attributes() []Attribute

func (*ComplexType) ContainsText

func (ct *ComplexType) ContainsText() bool

func (*ComplexType) Elements

func (ct *ComplexType) Elements() []Element

func (*ComplexType) GoName

func (ct *ComplexType) GoName() string

func (*ComplexType) GoTypeName

func (ct *ComplexType) GoTypeName() string

func (*ComplexType) HasXmlNameAttribute

func (ct *ComplexType) HasXmlNameAttribute() bool

func (*ComplexType) Schema

func (ct *ComplexType) Schema() *Schema

type Element

type Element struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema element"`
	Name    string   `xml:"name,attr"`

	XmlNameOverride string    `xml:"-"`
	FieldOverride   bool      `xml:"-"`
	Type            reference `xml:"type,attr"`
	Ref             reference `xml:"ref,attr"`
	MinOccurs       string    `xml:"minOccurs,attr"`
	MaxOccurs       string    `xml:"maxOccurs,attr"`

	ComplexType *ComplexType `xml:"complexType"`
	SimpleType  *SimpleType  `xml:"simpleType"`
	// contains filtered or unexported fields
}

Element defines single XML element

func (*Element) Array

func (e *Element) Array() bool

func (*Element) Attributes

func (e *Element) Attributes() []Attribute

func (*Element) ContainsText

func (e *Element) ContainsText() bool

func (*Element) Elements

func (e *Element) Elements() []Element

func (*Element) GoFieldName

func (e *Element) GoFieldName() string

func (*Element) GoForeignModule

func (e *Element) GoForeignModule() string

func (*Element) GoMemLayout

func (e *Element) GoMemLayout() string

func (*Element) GoName

func (e *Element) GoName() string

func (*Element) GoTypeName

func (e *Element) GoTypeName() string

func (*Element) XmlName

func (e *Element) XmlName() string

type Enumeration

type Enumeration struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema enumeration"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

Attribute defines single XML attribute

func (*Enumeration) GoName

func (e *Enumeration) GoName() string

Public Go Name of this struct item

func (*Enumeration) Modifiers

func (e *Enumeration) Modifiers() string

func (*Enumeration) XmlName

func (e *Enumeration) XmlName() string

type Extension

type Extension struct {
	XMLName          xml.Name         `xml:"http://www.w3.org/2001/XMLSchema extension"`
	Base             reference        `xml:"base,attr"`
	AttributesDirect []Attribute      `xml:"attribute"`
	AttributeGroups  []AttributeGroup `xml:"attributeGroup"`
	Sequence         *Sequence        `xml:"sequence"`
	// contains filtered or unexported fields
}

func (*Extension) Attributes

func (ext *Extension) Attributes() []Attribute

func (*Extension) ContainsText

func (ext *Extension) ContainsText() bool

func (*Extension) Elements

func (ext *Extension) Elements() []Element

func (*Extension) GoName

func (ext *Extension) GoName() string

type FractionDigits

type FractionDigits struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema fractionDigits"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type GenericContent

type GenericContent interface {
	Attributes() []Attribute
	Elements() []Element
	ContainsText() bool
	// contains filtered or unexported methods
}

type Import

type Import struct {
	XMLName        xml.Name `xml:"http://www.w3.org/2001/XMLSchema import"`
	Namespace      string   `xml:"namespace,attr"`
	SchemaLocation string   `xml:"schemaLocation,attr"`
	ImportedSchema *Schema  `xml:"-"`
}

type Include

type Include struct {
	XMLName        xml.Name `xml:"http://www.w3.org/2001/XMLSchema include"`
	Namespace      string   `xml:"namespace,attr"`
	SchemaLocation string   `xml:"schemaLocation,attr"`
	IncludedSchema *Schema  `xml:"-"`
}

type Length

type Length struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema length"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MaxExclusive

type MaxExclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxExclusive"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MaxInclusive

type MaxInclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxInclusive"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MaxLength

type MaxLength struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxLength"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MinExclusive

type MinExclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minExclusive"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MinInclusive

type MinInclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minInclusive"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type MinLength

type MinLength struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minLength"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type Pattern

type Pattern struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema pattern"`
	Value   string   `xml:"value,attr"`
}

type Restriction

type Restriction struct {
	XMLName          xml.Name        `xml:"http://www.w3.org/2001/XMLSchema restriction"`
	Base             reference       `xml:"base,attr"`
	AttributesDirect []Attribute     `xml:"attribute"`
	EnumsDirect      []Enumeration   `xml:"enumeration"`
	SimpleContent    *SimpleContent  `xml:"simpleContent"`
	WhiteSpace       *WhiteSpace     `xml:"whiteSpace"`
	Pattern          *Pattern        `xml:"pattern"`
	MinExclusive     *MinExclusive   `xml:"minExclusive"`
	MaxExclusive     *MaxExclusive   `xml:"maxExclusive"`
	MinInclusive     *MinInclusive   `xml:"minInclusive"`
	MaxInclusive     *MaxInclusive   `xml:"maxInclusive"`
	TotalDigits      *TotalDigits    `xml:"totalDigits"`
	FractionDigits   *FractionDigits `xml:"fractionDigits"`
	Length           *Length         `xml:"length"`
	MinLength        *MinLength      `xml:"minLength"`
	MaxLength        *MaxLength      `xml:"maxLength"`
	// contains filtered or unexported fields
}

func (*Restriction) Attributes

func (r *Restriction) Attributes() []Attribute

func (*Restriction) Enums

func (r *Restriction) Enums() []Enumeration

type Schema

type Schema struct {
	XMLName         xml.Name         `xml:"http://www.w3.org/2001/XMLSchema schema"`
	Xmlns           Xmlns            `xml:"-"`
	TargetNamespace string           `xml:"targetNamespace,attr"`
	Includes        []Include        `xml:"include"`
	Imports         []Import         `xml:"import"`
	Elements        []Element        `xml:"element"`
	Attributes      []Attribute      `xml:"attribute"`
	AttributeGroups []AttributeGroup `xml:"attributeGroup"`
	ComplexTypes    []ComplexType    `xml:"complexType"`
	SimpleTypes     []SimpleType     `xml:"simpleType"`

	ModulesPath string `xml:"-"`
	// contains filtered or unexported fields
}

Schema is the root XSD element

func (*Schema) Empty

func (sch *Schema) Empty() bool

func (*Schema) ExportableComplexTypes

func (sch *Schema) ExportableComplexTypes() []ComplexType

func (*Schema) ExportableElements

func (sch *Schema) ExportableElements() []Element

func (*Schema) ExportableSimpleTypes

func (sch *Schema) ExportableSimpleTypes() []SimpleType

func (*Schema) GetAttribute

func (sch *Schema) GetAttribute(name string) *Attribute

func (*Schema) GetElement

func (sch *Schema) GetElement(name string) *Element

func (*Schema) GetType

func (sch *Schema) GetType(name string) Type

func (*Schema) GoImportsNeeded

func (sch *Schema) GoImportsNeeded() []string

func (*Schema) GoPackageName

func (sch *Schema) GoPackageName() string

func (*Schema) UnmarshalXML

func (sch *Schema) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Sequence

type Sequence struct {
	XMLName     xml.Name  `xml:"http://www.w3.org/2001/XMLSchema sequence"`
	ElementList []Element `xml:"element"`
	Choices     []Choice  `xml:"choice"`
	Any         []Any     `xml:"any"`
	// contains filtered or unexported fields
}

func (*Sequence) Elements

func (s *Sequence) Elements() []Element

type SequenceAll

type SequenceAll struct {
	XMLName     xml.Name  `xml:"http://www.w3.org/2001/XMLSchema all"`
	ElementList []Element `xml:"element"`
	Choices     []Choice  `xml:"choice"`
	Any         []Any     `xml:"any"`
	// contains filtered or unexported fields
}

func (*SequenceAll) Elements

func (s *SequenceAll) Elements() []Element

type SimpleContent

type SimpleContent struct {
	XMLName     xml.Name     `xml:"http://www.w3.org/2001/XMLSchema simpleContent"`
	Extension   *Extension   `xml:"extension"`
	Restriction *Restriction `xml:"restriction"`
	// contains filtered or unexported fields
}

func (*SimpleContent) Attributes

func (sc *SimpleContent) Attributes() []Attribute

func (*SimpleContent) ContainsText

func (sc *SimpleContent) ContainsText() bool

func (*SimpleContent) Elements

func (sc *SimpleContent) Elements() []Element

type SimpleType

type SimpleType struct {
	XMLName     xml.Name     `xml:"http://www.w3.org/2001/XMLSchema simpleType"`
	Name        string       `xml:"name,attr"`
	Restriction *Restriction `xml:"restriction"`
	// contains filtered or unexported fields
}

func (*SimpleType) Attributes

func (st *SimpleType) Attributes() []Attribute

func (*SimpleType) ContainsText

func (st *SimpleType) ContainsText() bool

func (*SimpleType) Elements

func (st *SimpleType) Elements() []Element

func (*SimpleType) Enums

func (st *SimpleType) Enums() []Enumeration

func (*SimpleType) GoName

func (st *SimpleType) GoName() string

func (*SimpleType) GoTypeName

func (st *SimpleType) GoTypeName() string

func (*SimpleType) Schema

func (st *SimpleType) Schema() *Schema

type TotalDigits

type TotalDigits struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema totalDigits"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type Type

type Type interface {
	GoName() string
	GoTypeName() string
	Schema() *Schema
	Attributes() []Attribute
	Elements() []Element
	ContainsText() bool
	// contains filtered or unexported methods
}

type WhiteSpace

type WhiteSpace struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema whiteSpace"`
	Value   string   `xml:"value,attr"`
	Fixed   *bool    `xml:"fixed,attr"`
}

type Workspace

type Workspace struct {
	Cache         map[string]*Schema
	GoModulesPath string
	// contains filtered or unexported fields
}

func NewWorkspace

func NewWorkspace(goModulesPath, xsdPath string, xmlnsOverrides []string) (*Workspace, error)

type Xmlns

type Xmlns []xmlns

func (Xmlns) PrefixByUri

func (declarations Xmlns) PrefixByUri(uri string) string

func (Xmlns) UriByPrefix

func (declarations Xmlns) UriByPrefix(prefix string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL