Documentation ¶
Index ¶
- Variables
- func GetFileList(path string) (files []string, err error)
- func MakeFirstUpperCase(s string) string
- func PrepareOutputDir(path string) error
- func ToSnakeCase(input string) string
- func ToTitle(val string) string
- type Attribute
- type AttributeGroup
- type Choice
- type CodeGenerator
- func (gen *CodeGenerator) CAttribute(v *Attribute)
- func (gen *CodeGenerator) CAttributeGroup(v *AttributeGroup)
- func (gen *CodeGenerator) CComplexType(v *ComplexType)
- func (gen *CodeGenerator) CElement(v *Element)
- func (gen *CodeGenerator) CGroup(v *Group)
- func (gen *CodeGenerator) CSimpleType(v *SimpleType)
- func (gen *CodeGenerator) GenC() error
- func (gen *CodeGenerator) GenGo() error
- func (gen *CodeGenerator) GenJava() error
- func (gen *CodeGenerator) GenRust() error
- func (gen *CodeGenerator) GenTypeScript() error
- func (gen *CodeGenerator) GoAttribute(v *Attribute)
- func (gen *CodeGenerator) GoAttributeGroup(v *AttributeGroup)
- func (gen *CodeGenerator) GoComplexType(v *ComplexType)
- func (gen *CodeGenerator) GoElement(v *Element)
- func (gen *CodeGenerator) GoGroup(v *Group)
- func (gen *CodeGenerator) GoSimpleType(v *SimpleType)
- func (gen *CodeGenerator) JavaAttribute(v *Attribute)
- func (gen *CodeGenerator) JavaAttributeGroup(v *AttributeGroup)
- func (gen *CodeGenerator) JavaComplexType(v *ComplexType)
- func (gen *CodeGenerator) JavaElement(v *Element)
- func (gen *CodeGenerator) JavaGroup(v *Group)
- func (gen *CodeGenerator) JavaSimpleType(v *SimpleType)
- func (gen *CodeGenerator) RustAttribute(v *Attribute)
- func (gen *CodeGenerator) RustAttributeGroup(v *AttributeGroup)
- func (gen *CodeGenerator) RustComplexType(v *ComplexType)
- func (gen *CodeGenerator) RustElement(v *Element)
- func (gen *CodeGenerator) RustGroup(v *Group)
- func (gen *CodeGenerator) RustSimpleType(v *SimpleType)
- func (gen *CodeGenerator) TypeScriptAttribute(v *Attribute)
- func (gen *CodeGenerator) TypeScriptAttributeGroup(v *AttributeGroup)
- func (gen *CodeGenerator) TypeScriptComplexType(v *ComplexType)
- func (gen *CodeGenerator) TypeScriptElement(v *Element)
- func (gen *CodeGenerator) TypeScriptGroup(v *Group)
- func (gen *CodeGenerator) TypeScriptSimpleType(v *SimpleType)
- type ComplexType
- type Element
- type Group
- type Options
- func (opt *Options) EndAttribute(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndAttributeGroup(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndChoice(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndComplexType(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndElement(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndEnumeration(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndExtension(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndFractionDigits(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndGroup(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndLength(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMaxExclusive(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMaxInclusive(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMaxLength(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMinExclusive(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMinInclusive(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndMinLength(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndPattern(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndRestriction(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndSimpleType(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndTotalDigits(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndUnion(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) EndWhiteSpace(ele xml.EndElement, protoTree []interface{}) (err error)
- func (opt *Options) GetValueType(value string, XSDSchema []interface{}) (valueType string, err error)
- func (opt *Options) OnAttribute(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnAttributeGroup(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnCharData(ele string, protoTree []interface{}) (err error)
- func (opt *Options) OnChoice(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnComplexType(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnElement(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnEnumeration(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnExtension(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnGroup(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnImport(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnInclude(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnList(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnPattern(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnRestriction(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnSchema(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnSimpleType(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) OnUnion(ele xml.StartElement, protoTree []interface{}) (err error)
- func (opt *Options) Parse() (err error)
- type Restriction
- type SimpleType
- type Stack
Constants ¶
This section is empty.
Variables ¶
var BuildInTypes = map[string][]string{
"anyType": {"string", "string", "char", "String", "String"},
"ENTITIES": {"[]string", "Array<string>", "char[]", "List<String>", "Vec<String>"},
"ENTITY": {"string", "string", "char", "String", "String"},
"ID": {"string", "string", "char", "String", "String"},
"IDREF": {"string", "string", "char", "String", "String"},
"IDREFS": {"[]string", "Array<string>", "char[]", "List<String>", "Vec<String>"},
"NCName": {"string", "string", "char", "String", "String"},
"NMTOKEN": {"string", "string", "char", "String", "String"},
"NMTOKENS": {"[]string", "Array<string>", "char[]", "List<String>", "Vec<String>"},
"NOTATION": {"[]string", "Array<string>", "char[]", "List<String>", "Vec<String>"},
"Name": {"string", "string", "char", "String", "String"},
"QName": {"xml.Name", "any", "char", "String", "String"},
"anyURI": {"string", "string", "char", "QName", "String"},
"base64Binary": {"[]byte", "Uint8Array", "char[]", "List<Byte>", "String"},
"boolean": {"bool", "boolean", "bool", "Boolean", "bool"},
"byte": {"byte", "any", "char[]", "Byte", "u8"},
"date": {"string", "string", "char", "String", "u8"},
"dateTime": {"string", "string", "char", "String", "u8"},
"decimal": {"float64", "number", "float", "Float", "f64"},
"double": {"float64", "number", "float", "Float", "f64"},
"duration": {"string", "string", "char", "String", "String"},
"float": {"float32", "number", "float", "Float", "f64"},
"gDay": {"string", "string", "char", "String", "String"},
"gMonth": {"string", "string", "char", "String", "String"},
"gMonthDay": {"string", "string", "char", "String", "String"},
"gYear": {"string", "string", "char", "String", "String"},
"gYearMonth": {"string", "string", "char", "String", "String"},
"hexBinary": {"[]byte", "Uint8Array", "char[]", "List<Byte>", "String"},
"int": {"int", "number", "int", "Integer", "i32"},
"integer": {"int", "number", "int", "Integer", "i32"},
"language": {"string", "string", "char", "String", "String"},
"long": {"int64", "number", "int", "Long", "i64"},
"negativeInteger": {"int", "number", "int", "Integer", "i32"},
"nonNegativeInteger": {"int", "number", "int", "Integer", "u32"},
"normalizedString": {"string", "string", "char", "String", "String"},
"nonPositiveInteger": {"int", "number", "int", "Integer", "i32"},
"positiveInteger": {"int", "number", "int", "Integer", "u32"},
"short": {"int16", "number", "int", "Integer", "i16"},
"string": {"string", "string", "char", "String", "String"},
"time": {"time.Time", "string", "char", "String", "String"},
"token": {"string", "string", "char", "String", "String"},
"unsignedByte": {"byte", "any", "char", "Byte", "u8"},
"unsignedInt": {"uint32", "number", "unsigned int", "Integer", "u32"},
"unsignedLong": {"uint64", "number", "unsigned int", "Long", "u64"},
"unsignedShort": {"uint16", "number", "unsigned int", "Short", "u16"},
"xml:lang": {"string", "string", "char", "String", "String"},
"xml:space": {"string", "string", "char", "String", "String"},
"xml:base": {"string", "string", "char", "String", "String"},
"xml:id": {"string", "string", "char", "String", "String"},
}
BuildInTypes defines the correspondence between Go, TypeScript, C, Java, Rust languages and data types in XSD. https://www.w3.org/TR/xmlschema-2/#datatype
Functions ¶
func GetFileList ¶
GetFileList get a list of file by given path.
func MakeFirstUpperCase ¶
MakeFirstUpperCase make the first letter of a string uppercase.
func PrepareOutputDir ¶
PrepareOutputDir provide a method to create the output directory by given path.
func ToSnakeCase ¶
ToSnakeCase converts the provided string to snake_case.
Types ¶
type Attribute ¶
type Attribute struct { Name string Doc string Type string Plural bool Default string Optional bool }
Attribute declarations provide for: Local validation of attribute information item values using a simple type definition; Specifying default or fixed values for attribute information items. https://www.w3.org/TR/xmlschema-1/structures.html#element-attribute
type AttributeGroup ¶
AttributeGroup definitions do not participate in ·validation· as such, but the {attribute uses} and {attribute wildcard} of one or more complex type definitions may be constructed in whole or part by reference to an attribute group. Thus, attribute group definitions provide a replacement for some uses of XML's parameter entity facility. Attribute group definitions are provided primarily for reference from the XML representation of schema components (see <complexType> and <attributeGroup>). https://www.w3.org/TR/xmlschema-1/structures.html#Attribute_Group_Definition
type Choice ¶
Choice definitions are provided primarily for reference from the XML Representation of Choice Definitions which acts as a container stating that one and only one element in the selected group should be present in the containing element. Generated code does not enforce the "one and only one" constraint but the choice container is parsed in order to effectively define if the elements it contains should be plural or not (as defined by the maxOccurs). https://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details
type CodeGenerator ¶
type CodeGenerator struct { Lang string File string Field string Package string ImportTime bool // For Go language ImportEncodingXML bool // For Go language IgnoreNameConflict bool // For Go language ProtoTree []interface{} StructAST map[string]string }
CodeGenerator holds code generator overrides and runtime data that are used when generate code from proto tree.
func (*CodeGenerator) CAttribute ¶
func (gen *CodeGenerator) CAttribute(v *Attribute)
CAttribute generates code for attribute XML schema in C language syntax.
func (*CodeGenerator) CAttributeGroup ¶
func (gen *CodeGenerator) CAttributeGroup(v *AttributeGroup)
CAttributeGroup generates code for attribute group XML schema in C language syntax.
func (*CodeGenerator) CComplexType ¶
func (gen *CodeGenerator) CComplexType(v *ComplexType)
CComplexType generates code for complex type XML schema in C language syntax.
func (*CodeGenerator) CElement ¶
func (gen *CodeGenerator) CElement(v *Element)
CElement generates code for element XML schema in C language syntax.
func (*CodeGenerator) CGroup ¶
func (gen *CodeGenerator) CGroup(v *Group)
CGroup generates code for group XML schema in C language syntax.
func (*CodeGenerator) CSimpleType ¶
func (gen *CodeGenerator) CSimpleType(v *SimpleType)
CSimpleType generates code for simple type XML schema in C language syntax.
func (*CodeGenerator) GenC ¶
func (gen *CodeGenerator) GenC() error
GenC generates C programming language source code for XML schema definition files.
func (*CodeGenerator) GenGo ¶
func (gen *CodeGenerator) GenGo() error
GenGo generate Go programming language source code for XML schema definition files.
func (*CodeGenerator) GenJava ¶
func (gen *CodeGenerator) GenJava() error
GenJava generate Java programming language source code for XML schema definition files.
func (*CodeGenerator) GenRust ¶
func (gen *CodeGenerator) GenRust() error
GenRust generate Go programming language source code for XML schema definition files.
func (*CodeGenerator) GenTypeScript ¶
func (gen *CodeGenerator) GenTypeScript() error
GenTypeScript generate TypeScript programming language source code for XML schema definition files.
func (*CodeGenerator) GoAttribute ¶
func (gen *CodeGenerator) GoAttribute(v *Attribute)
GoAttribute generates code for attribute XML schema in Go language syntax.
func (*CodeGenerator) GoAttributeGroup ¶
func (gen *CodeGenerator) GoAttributeGroup(v *AttributeGroup)
GoAttributeGroup generates code for attribute group XML schema in Go language syntax.
func (*CodeGenerator) GoComplexType ¶
func (gen *CodeGenerator) GoComplexType(v *ComplexType)
GoComplexType generates code for complex type XML schema in Go language syntax.
func (*CodeGenerator) GoElement ¶
func (gen *CodeGenerator) GoElement(v *Element)
GoElement generates code for element XML schema in Go language syntax.
func (*CodeGenerator) GoGroup ¶
func (gen *CodeGenerator) GoGroup(v *Group)
GoGroup generates code for group XML schema in Go language syntax.
func (*CodeGenerator) GoSimpleType ¶
func (gen *CodeGenerator) GoSimpleType(v *SimpleType)
GoSimpleType generates code for simple type XML schema in Go language syntax.
func (*CodeGenerator) JavaAttribute ¶
func (gen *CodeGenerator) JavaAttribute(v *Attribute)
JavaAttribute generates code for attribute XML schema in Java language syntax.
func (*CodeGenerator) JavaAttributeGroup ¶
func (gen *CodeGenerator) JavaAttributeGroup(v *AttributeGroup)
JavaAttributeGroup generates code for attribute group XML schema in Java language syntax.
func (*CodeGenerator) JavaComplexType ¶
func (gen *CodeGenerator) JavaComplexType(v *ComplexType)
JavaComplexType generates code for complex type XML schema in Java language syntax.
func (*CodeGenerator) JavaElement ¶
func (gen *CodeGenerator) JavaElement(v *Element)
JavaElement generates code for element XML schema in Java language syntax.
func (*CodeGenerator) JavaGroup ¶
func (gen *CodeGenerator) JavaGroup(v *Group)
JavaGroup generates code for group XML schema in Java language syntax.
func (*CodeGenerator) JavaSimpleType ¶
func (gen *CodeGenerator) JavaSimpleType(v *SimpleType)
JavaSimpleType generates code for simple type XML schema in Java language syntax.
func (*CodeGenerator) RustAttribute ¶
func (gen *CodeGenerator) RustAttribute(v *Attribute)
RustAttribute generates code for attribute XML schema in Rust language syntax.
func (*CodeGenerator) RustAttributeGroup ¶
func (gen *CodeGenerator) RustAttributeGroup(v *AttributeGroup)
RustAttributeGroup generates code for attribute group XML schema in Rust language syntax.
func (*CodeGenerator) RustComplexType ¶
func (gen *CodeGenerator) RustComplexType(v *ComplexType)
RustComplexType generates code for complex type XML schema in Rust language syntax.
func (*CodeGenerator) RustElement ¶
func (gen *CodeGenerator) RustElement(v *Element)
RustElement generates code for element XML schema in Rust language syntax.
func (*CodeGenerator) RustGroup ¶
func (gen *CodeGenerator) RustGroup(v *Group)
RustGroup generates code for group XML schema in Rust language syntax.
func (*CodeGenerator) RustSimpleType ¶
func (gen *CodeGenerator) RustSimpleType(v *SimpleType)
RustSimpleType generates code for simple type XML schema in Rust language syntax.
func (*CodeGenerator) TypeScriptAttribute ¶
func (gen *CodeGenerator) TypeScriptAttribute(v *Attribute)
TypeScriptAttribute generates code for attribute XML schema in TypeScript language syntax.
func (*CodeGenerator) TypeScriptAttributeGroup ¶
func (gen *CodeGenerator) TypeScriptAttributeGroup(v *AttributeGroup)
TypeScriptAttributeGroup generates code for attribute group XML schema in TypeScript language syntax.
func (*CodeGenerator) TypeScriptComplexType ¶
func (gen *CodeGenerator) TypeScriptComplexType(v *ComplexType)
TypeScriptComplexType generates code for complex type XML schema in TypeScript language syntax.
func (*CodeGenerator) TypeScriptElement ¶
func (gen *CodeGenerator) TypeScriptElement(v *Element)
TypeScriptElement generates code for element XML schema in TypeScript language syntax.
func (*CodeGenerator) TypeScriptGroup ¶
func (gen *CodeGenerator) TypeScriptGroup(v *Group)
TypeScriptGroup generates code for group XML schema in TypeScript language syntax.
func (*CodeGenerator) TypeScriptSimpleType ¶
func (gen *CodeGenerator) TypeScriptSimpleType(v *SimpleType)
TypeScriptSimpleType generates code for simple type XML schema in TypeScript language syntax.
type ComplexType ¶
type ComplexType struct { Doc string Name string Base string Anonymous bool Elements []Element Attributes []Attribute Groups []Group Choice []Choice AttributeGroup []AttributeGroup Mixed bool }
ComplexType definitions are identified by their {name} and {target namespace}. Except for anonymous complex type definitions (those with no {name}), since type definitions (i.e. both simple and complex type definitions taken together) must be uniquely identified within an ·XML Schema·, no complex type definition can have the same name as another simple or complex type definition. Complex type {name}s and {target namespace}s are provided for reference from instances, and for use in the XML representation of schema components (specifically in <element>). See References to schema components across namespaces for the use of component identifiers when importing one schema into another. https://www.w3.org/TR/xmlschema-1/structures.html#element-complexType
type Element ¶
type Element struct { Doc string Name string Wildcard bool Type string Abstract bool Plural bool Optional bool Nillable bool Default string }
Element declarations provide for: Local validation of element information item values using a type definition; Specifying default or fixed values for an element information items; Establishing uniquenesses and reference constraint relationships among the values of related elements and attributes; Controlling the substitutability of elements through the mechanism of element substitution groups. https://www.w3.org/TR/xmlschema-1/#cElement_Declarations
type Group ¶
type Group struct { Doc string Name string Elements []Element Groups []Group Plural bool Ref string }
Group (model group) definitions are provided primarily for reference from the XML Representation of Complex Type Definitions. Thus, model group definitions provide a replacement for some uses of XML's parameter entity facility. https://www.w3.org/TR/xmlschema-1/structures.html#cModel_Group_Definitions
type Options ¶
type Options struct { FilePath string FileDir string InputDir string OutputDir string Extract bool Lang string Package string IgnoreNameConflict bool IncludeMap map[string]bool LocalNameNSMap map[string]string NSSchemaLocationMap map[string]string ParseFileList map[string]bool ParseFileMap map[string][]interface{} ProtoTree []interface{} RemoteSchema map[string][]byte InElement string CurrentEle string InGroup int InUnion bool InAttributeGroup bool SimpleType *Stack ComplexType *Stack Element *Stack Attribute *Stack Group *Stack AttributeGroup *Stack Choice *Stack }
Options holds user-defined overrides and runtime data that are used when parsing from an XSD document.
func NewParser ¶
NewParser creates a new parser options for the Parse. Useful for XML schema parsing.
func (*Options) EndAttribute ¶
func (opt *Options) EndAttribute(ele xml.EndElement, protoTree []interface{}) (err error)
EndAttribute handles parsing event on the attribute end elements.
func (*Options) EndAttributeGroup ¶
func (opt *Options) EndAttributeGroup(ele xml.EndElement, protoTree []interface{}) (err error)
EndAttributeGroup handles parsing event on the attributeGroup end elements.
func (*Options) EndChoice ¶
func (opt *Options) EndChoice(ele xml.EndElement, protoTree []interface{}) (err error)
EndChoice handles parsing event on the choice end elements.
func (*Options) EndComplexType ¶
func (opt *Options) EndComplexType(ele xml.EndElement, protoTree []interface{}) (err error)
EndComplexType handles parsing event on the complex end elements.
func (*Options) EndElement ¶
func (opt *Options) EndElement(ele xml.EndElement, protoTree []interface{}) (err error)
EndElement handles parsing event on the element end elements.
func (*Options) EndEnumeration ¶
func (opt *Options) EndEnumeration(ele xml.EndElement, protoTree []interface{}) (err error)
EndEnumeration handles parsing event on the enumeration end elements. Enumeration defines a list of acceptable values.
func (*Options) EndExtension ¶
func (opt *Options) EndExtension(ele xml.EndElement, protoTree []interface{}) (err error)
EndExtension handles parsing event on the extension end elements.
func (*Options) EndFractionDigits ¶
func (opt *Options) EndFractionDigits(ele xml.EndElement, protoTree []interface{}) (err error)
EndFractionDigits handles parsing event on the fractionDigits end elements. Enumeration Defines a list of acceptable values. FractionDigits specifies the maximum number of decimal places allowed. Must be equal to or greater than zero.
func (*Options) EndGroup ¶
func (opt *Options) EndGroup(ele xml.EndElement, protoTree []interface{}) (err error)
EndGroup handles parsing event on the group end elements.
func (*Options) EndLength ¶
func (opt *Options) EndLength(ele xml.EndElement, protoTree []interface{}) (err error)
EndLength handles parsing event on the length end elements. Length specifies the exact number of characters or list items allowed. Must be equal to or greater than zero.
func (*Options) EndMaxExclusive ¶
func (opt *Options) EndMaxExclusive(ele xml.EndElement, protoTree []interface{}) (err error)
EndMaxExclusive handles parsing event on the maxExclusive end elements. MaxExclusive specifies the upper bounds for numeric values (the value must be less than this value).
func (*Options) EndMaxInclusive ¶
func (opt *Options) EndMaxInclusive(ele xml.EndElement, protoTree []interface{}) (err error)
EndMaxInclusive handles parsing event on the maxInclusive end elements. MaxInclusive specifies the upper bounds for numeric values (the value must be less than or equal to this value).
func (*Options) EndMaxLength ¶
func (opt *Options) EndMaxLength(ele xml.EndElement, protoTree []interface{}) (err error)
EndMaxLength handles parsing event on the maxLength end elements. MaxLength specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero.
func (*Options) EndMinExclusive ¶
func (opt *Options) EndMinExclusive(ele xml.EndElement, protoTree []interface{}) (err error)
EndMinExclusive handles parsing event on the minExclusive end elements. MinExclusive specifies the lower bounds for numeric values (the value must be greater than this value).
func (*Options) EndMinInclusive ¶
func (opt *Options) EndMinInclusive(ele xml.EndElement, protoTree []interface{}) (err error)
EndMinInclusive handles parsing event on the minInclusive end elements. MinInclusive specifies the lower bounds for numeric values (the value must be greater than or equal to this value).
func (*Options) EndMinLength ¶
func (opt *Options) EndMinLength(ele xml.EndElement, protoTree []interface{}) (err error)
EndMinLength handles parsing event on the minLength end elements. MinLength specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero.
func (*Options) EndPattern ¶
func (opt *Options) EndPattern(ele xml.EndElement, protoTree []interface{}) (err error)
EndPattern handles parsing event on the pattern end elements. Pattern defines the exact sequence of characters that are acceptable.
func (*Options) EndRestriction ¶
func (opt *Options) EndRestriction(ele xml.EndElement, protoTree []interface{}) (err error)
EndRestriction handles parsing event on the restriction end elements.
func (*Options) EndSimpleType ¶
func (opt *Options) EndSimpleType(ele xml.EndElement, protoTree []interface{}) (err error)
EndSimpleType handles parsing event on the simpleType end elements.
func (*Options) EndTotalDigits ¶
func (opt *Options) EndTotalDigits(ele xml.EndElement, protoTree []interface{}) (err error)
EndTotalDigits handles parsing event on the totalDigits end elements. TotalDigits specifies the exact number of digits allowed. Must be greater than zero.
func (*Options) EndUnion ¶
func (opt *Options) EndUnion(ele xml.EndElement, protoTree []interface{}) (err error)
EndUnion handles parsing event on the union end elements.
func (*Options) EndWhiteSpace ¶
func (opt *Options) EndWhiteSpace(ele xml.EndElement, protoTree []interface{}) (err error)
EndWhiteSpace handles parsing event on the whiteSpace end elements. WhiteSpace specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled.
func (*Options) GetValueType ¶
func (opt *Options) GetValueType(value string, XSDSchema []interface{}) (valueType string, err error)
GetValueType convert XSD schema value type to the build-in type for the given value and proto tree.
func (*Options) OnAttribute ¶
func (opt *Options) OnAttribute(ele xml.StartElement, protoTree []interface{}) (err error)
OnAttribute handles parsing event on the attribute start elements. All attributes are declared as simple types.
func (*Options) OnAttributeGroup ¶
func (opt *Options) OnAttributeGroup(ele xml.StartElement, protoTree []interface{}) (err error)
OnAttributeGroup handles parsing event on the attributeGroup start elements. The attributeGroup element is used to group a set of attribute declarations so that they can be incorporated as a group into complex type definitions.
func (*Options) OnCharData ¶
OnCharData handles parsing event on the documentation start elements. The documentation element specifies information to be read or used by users within an annotation element.
func (*Options) OnChoice ¶
func (opt *Options) OnChoice(ele xml.StartElement, protoTree []interface{}) (err error)
OnChoice handles parsing event on the choice start elements. The choice element defines that one and only one of the contained element can be present within the contained element.
func (*Options) OnComplexType ¶
func (opt *Options) OnComplexType(ele xml.StartElement, protoTree []interface{}) (err error)
OnComplexType handles parsing event on the complex start elements. A complex element contains other elements and/or attributes.
func (*Options) OnElement ¶
func (opt *Options) OnElement(ele xml.StartElement, protoTree []interface{}) (err error)
OnElement handles parsing event on the element start elements.
func (*Options) OnEnumeration ¶
func (opt *Options) OnEnumeration(ele xml.StartElement, protoTree []interface{}) (err error)
OnEnumeration handles parsing event on the enumeration start elements.
func (*Options) OnExtension ¶
func (opt *Options) OnExtension(ele xml.StartElement, protoTree []interface{}) (err error)
OnExtension handles parsing event on the extension start elements. The extension element defines a base class for a complexType or simpleContent.
func (*Options) OnGroup ¶
func (opt *Options) OnGroup(ele xml.StartElement, protoTree []interface{}) (err error)
OnGroup handles parsing event on the group start elements. The group element is used to define a group of elements to be used in complex type definitions.
func (*Options) OnImport ¶
func (opt *Options) OnImport(ele xml.StartElement, protoTree []interface{}) (err error)
OnImport handles parsing event on the import start elements. The list element defines a simple type element as a list of values of a specified data type.
func (*Options) OnInclude ¶
func (opt *Options) OnInclude(ele xml.StartElement, protoTree []interface{}) (err error)
OnInclude handles parsing event on the include start elements. The list element defines a simple type element as a list of values of a specified data type.
func (*Options) OnList ¶
func (opt *Options) OnList(ele xml.StartElement, protoTree []interface{}) (err error)
OnList handles parsing event on the list start elements. The list element defines a simple type element as a list of values of a specified data type.
func (*Options) OnPattern ¶
func (opt *Options) OnPattern(ele xml.StartElement, protoTree []interface{}) (err error)
OnPattern handles parsing event on the pattern start elements.
func (*Options) OnRestriction ¶
func (opt *Options) OnRestriction(ele xml.StartElement, protoTree []interface{}) (err error)
OnRestriction handles parsing event on the restriction start elements. The restriction element defines restrictions on a simpleType, simpleContent, or complexContent definition.
func (*Options) OnSchema ¶
func (opt *Options) OnSchema(ele xml.StartElement, protoTree []interface{}) (err error)
OnSchema handles parsing event on the schema start elements. Schema is the root element of every XML Schema.
func (*Options) OnSimpleType ¶
func (opt *Options) OnSimpleType(ele xml.StartElement, protoTree []interface{}) (err error)
OnSimpleType handles parsing event on the simpleType start elements. The simpleType element defines a simple type and specifies the constraints and information about the values of attributes or text-only elements.
type Restriction ¶
type Restriction struct { Doc string Precision int Enum []string Min, Max float64 MinLength, MaxLength int Pattern *regexp.Regexp }
Restriction are used to define acceptable values for XML elements or attributes. Restriction on XML elements are called facets. https://www.w3.org/TR/xmlschema-1/structures.html#element-restriction
type SimpleType ¶
type SimpleType struct { Doc string Name string Base string Anonymous bool List bool Union bool MemberTypes map[string]string Restriction Restriction }
SimpleType definitions provide for constraining character information item [children] of element and attribute information items. https://www.w3.org/TR/xmlschema-1/#Simple_Type_Definitions
Source Files ¶
- genC.go
- genGo.go
- genJava.go
- genRust.go
- genTypeScript.go
- parser.go
- proto.go
- schema.go
- stack.go
- utils.go
- xmlAttribute.go
- xmlAttributeGroup.go
- xmlCharData.go
- xmlChoice.go
- xmlComplexType.go
- xmlElement.go
- xmlEnumeration.go
- xmlExtension.go
- xmlFractionDigits.go
- xmlGroup.go
- xmlImport.go
- xmlInclude.go
- xmlLength.go
- xmlList.go
- xmlMaxExclusive.go
- xmlMaxInclusive.go
- xmlMaxLength.go
- xmlMinExclusive.go
- xmlMinInclusive.go
- xmlMinLength.go
- xmlPattern.go
- xmlRestriction.go
- xmlSchema.go
- xmlSimpleType.go
- xmlTotalDigits.go
- xmlUnion.go
- xmlWhiteSpace.go