xsd

package
v0.0.0-...-1e5fc91 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2015 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakePath

func MakePath(path []string) string

Types

type ComplexContent

type ComplexContent struct {
	XMLName   xml.Name  `xml:"http://www.w3.org/2001/XMLSchema complexContent"`
	Extension Extension `xml:"http://www.w3.org/2001/XMLSchema extension"`
}

type ComplexType

type ComplexType struct {
	XMLName  xml.Name        `xml:"http://www.w3.org/2001/XMLSchema complexType"`
	Name     string          `xml:"name,attr"`
	Abstract bool            `xml:"abstract,attr"`
	Sequence []Element       `xml:"sequence>element"`
	Content  *ComplexContent `xml:"http://www.w3.org/2001/XMLSchema complexContent"`
}

func (*ComplexType) Encode

func (self *ComplexType) Encode(enc *xml.Encoder, sr SchemaRepository, ga GetAliaser, params map[string]interface{}, path ...string) (err error)

type Element

type Element struct {
	XMLName      xml.Name     `xml:"http://www.w3.org/2001/XMLSchema element"`
	Type         string       `xml:"type,attr"`
	Nillable     string       `xml:"nillable,attr"`
	MinOccurs    string       `xml:"minOccurs,attr"`
	MaxOccurs    string       `xml:"maxOccurs,attr"`
	Form         string       `xml:"form,attr"`
	Name         string       `xml:"name,attr"`
	ComplexTypes *ComplexType `xml:"http://www.w3.org/2001/XMLSchema complexType"`
}

func (*Element) Encode

func (self *Element) Encode(enc *xml.Encoder, sr SchemaRepository, ga GetAliaser, params map[string]interface{}, path ...string) (err error)

type Enumeration

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

type Extension

type Extension struct {
	XMLName  xml.Name  `xml:"http://www.w3.org/2001/XMLSchema extension"`
	Base     string    `xml:"base,attr"`
	Sequence []Element `xml:"sequence>element"`
}

type GetAliaser

type GetAliaser interface {
	GetAlias(string) string
	Namespace() string
}

type InnerSchema

type InnerSchema struct {
	TargetNamespace    string        `xml:"targetNamespace,attr"`
	ElementFormDefault string        `xml:"elementFormDefault,attr"`
	Version            string        `xml:"version,attr"`
	ComplexTypes       []ComplexType `xml:"http://www.w3.org/2001/XMLSchema complexType"`
	SimpleTypes        []SimpleType  `xml:"http://www.w3.org/2001/XMLSchema simpleType"`
	Elements           []Element     `xml:"http://www.w3.org/2001/XMLSchema element"`
}

type Schema

type Schema struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema schema"`
	Aliases map[string]string
	InnerSchema
}

func (*Schema) EncodeElement

func (self *Schema) EncodeElement(name string, enc *xml.Encoder, sr SchemaRepository, params map[string]interface{}, path ...string) error

func (*Schema) EncodeType

func (self *Schema) EncodeType(name string, enc *xml.Encoder, sr SchemaRepository, params map[string]interface{}, path ...string) error

func (*Schema) GetAlias

func (self *Schema) GetAlias(alias string) (space string)

func (*Schema) Namespace

func (self *Schema) Namespace() string

func (*Schema) UnmarshalXML

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

type SchemaMap

type SchemaMap map[string]Schema

func (SchemaMap) GetElement

func (self SchemaMap) GetElement(space, name string) *Element

func (SchemaMap) GetSchema

func (self SchemaMap) GetSchema(space string) (s Schemaer, err error)

type SchemaRepository

type SchemaRepository interface {
	GetSchema(space string) (Schemaer, error)
}

type Schemaer

type Schemaer interface {
	EncodeElement(name string, enc *xml.Encoder, sr SchemaRepository, params map[string]interface{}, path ...string) (err error)
	EncodeType(name string, enc *xml.Encoder, sr SchemaRepository, params map[string]interface{}, path ...string) (err error)
}

type SimpleType

type SimpleType struct {
	XMLName     xml.Name              `xml:"http://www.w3.org/2001/XMLSchema simpleType"`
	Name        string                `xml:"name,attr"`
	Restriction SimpleTypeRestriction `xml:"restriction"`
}

func (*SimpleType) Encode

func (self *SimpleType) Encode(enc *xml.Encoder, sr SchemaRepository, ga GetAliaser, params map[string]interface{}, path ...string) (err error)

type SimpleTypeRestriction

type SimpleTypeRestriction struct {
	XMLName      xml.Name      `xml:"http://www.w3.org/2001/XMLSchema restriction"`
	Base         string        `xml:"base,attr"`
	Enumerations []Enumeration `xml:"http://www.w3.org/2001/XMLSchema enumeration"`
}

Jump to

Keyboard shortcuts

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