Documentation
¶
Overview ¶
Package model defines the XSD schema model and shared type-system structures.
Index ¶
- Constants
- Variables
- func AllowsNamespace(constraint NamespaceConstraint, list []NamespaceURI, targetNS, ns NamespaceURI) bool
- func ApplyWhiteSpace(lexical string, ws WhiteSpace) string
- func CompareTypedValues(left, right TypedValue) bool
- func ElementTypesCompatible(a, b Type) bool
- func FieldsXMLWhitespaceSeq(lexical string) iter.Seq[string]
- func HasTimezone(lexical string) bool
- func IdentityNormalizable(typ Type) bool
- func IsAnySimpleTypeQName(qname QName) bool
- func IsAnyTypeQName(qname QName) bool
- func IsDateTimeTypeName(typeName string) bool
- func IsDerivedFrom(derived, base Type) bool
- func IsIntegerTypeName(typeName string) bool
- func IsNumericTypeName(typeName string) bool
- func IsPlaceholderSimpleType(simpleType *SimpleType) bool
- func IsQNameOrNotation(name QName) bool
- func IsValidlyDerivedFrom(derived, base Type) bool
- func NamespaceConstraintSubset(derivedConstraint NamespaceConstraint, derivedList []NamespaceURI, ...) bool
- func NormalizeTypeValue(lexical string, typ Type) (string, error)
- func NormalizeWhiteSpace(lexical string, typ Type) string
- func ParseDuration(lexical string) (string, error)
- func ProcessContentsStrongerOrEqual(derived, base ProcessContents) bool
- func SecondsToDuration(sec num.Dec) (time.Duration, error)
- func TimezoneKind(lexical string) value.TimezoneKind
- func TranslateXSDPatternToGo(xsdPattern string) (string, error)
- func ValidateFacetApplicability(facetName string, baseType Type, baseQName QName) error
- func ValidateSimpleTypeWithOptions(st *SimpleType, lexical string, context map[string]string, ...) error
- func ValueAs[T any](typedValue TypedValue) (T, error)
- func WalkParticles(particles []Particle, h ParticleHandlers) error
- type AnyAttribute
- type AnyElement
- type AttributeDecl
- type AttributeGroup
- type AttributeUse
- type Base64BinaryValue
- type BooleanValue
- type BuiltinType
- func (b *BuiltinType) BaseType() Type
- func (b *BuiltinType) FundamentalFacets() *FundamentalFacets
- func (b *BuiltinType) HasByteValidator() bool
- func (b *BuiltinType) IsBuiltin() bool
- func (b *BuiltinType) MeasureLength(value string) int
- func (b *BuiltinType) Name() QName
- func (b *BuiltinType) Ordered() bool
- func (b *BuiltinType) ParseValue(lexical string) (TypedValue, error)
- func (b *BuiltinType) PrimitiveType() Type
- func (b *BuiltinType) ResolvedBaseType() Type
- func (b *BuiltinType) Validate(value string) error
- func (b *BuiltinType) ValidateBytes(value []byte) (bool, error)
- func (b *BuiltinType) Variety() SimpleTypeVariety
- func (b *BuiltinType) WhiteSpace() WhiteSpace
- type ByteValue
- type Cardinality
- type ComparableDec
- type ComparableDuration
- type ComparableFloat32
- type ComparableFloat64
- type ComparableInt
- type ComparableTime
- type ComparableValue
- type ComparableXSDDuration
- type ComplexContent
- type ComplexType
- func (c *ComplexType) AnyAttribute() *AnyAttribute
- func (c *ComplexType) Attributes() []*AttributeDecl
- func (c *ComplexType) BaseType() Type
- func (c *ComplexType) ComponentName() QName
- func (c *ComplexType) Content() Content
- func (c *ComplexType) Copy(opts CopyOptions) *ComplexType
- func (c *ComplexType) DeclaredNamespace() NamespaceURI
- func (c *ComplexType) EffectiveMixed() bool
- func (c *ComplexType) FundamentalFacets() *FundamentalFacets
- func (c *ComplexType) IsBuiltin() bool
- func (c *ComplexType) IsDerived() bool
- func (c *ComplexType) IsExtension() bool
- func (c *ComplexType) IsRestriction() bool
- func (c *ComplexType) Mixed() bool
- func (c *ComplexType) Name() QName
- func (c *ComplexType) PrimitiveType() Type
- func (c *ComplexType) ResolvedBaseType() Type
- func (c *ComplexType) SetAnyAttribute(anyAttr *AnyAttribute)
- func (c *ComplexType) SetAttributes(attributes []*AttributeDecl)
- func (c *ComplexType) SetContent(content Content)
- func (c *ComplexType) SetMixed(mixed bool)
- func (c *ComplexType) WhiteSpace() WhiteSpace
- type ConstraintType
- type Content
- type CopyOptions
- type DateTimeValue
- type DecimalValue
- type DeferredFacet
- type DeferredFacetConverter
- type DerivationMethod
- type DerivationSet
- type DerivedType
- type DoubleValue
- type ElementContent
- type ElementDecl
- type EmptyContent
- type Enumeration
- func (e *Enumeration) AppendValue(value string, context map[string]string)
- func (e *Enumeration) Name() string
- func (e *Enumeration) QNameValues() []QName
- func (e *Enumeration) ResolveQNameValues() ([]QName, error)
- func (e *Enumeration) Seal()
- func (e *Enumeration) SetQNameValues(values []QName)
- func (e *Enumeration) SetValueContexts(values []map[string]string)
- func (e *Enumeration) Validate(value TypedValue, baseType Type) error
- func (e *Enumeration) ValidateLexical(lexical string, baseType Type) error
- func (e *Enumeration) ValidateLexicalQName(lexical string, baseType Type, context map[string]string) error
- func (e *Enumeration) ValueContexts() []map[string]string
- func (e *Enumeration) Values() []string
- type Extension
- type Facet
- func CollectRestrictionFacetsWithResolver(restriction *Restriction, baseType Type, resolve FacetTypeResolver, ...) ([]Facet, error)
- func CollectSimpleTypeFacetsWithResolver(st *SimpleType, resolve FacetTypeResolver, convert DeferredFacetConverter) ([]Facet, error)
- func NewMaxExclusive(lexical string, baseType Type) (Facet, error)
- func NewMaxInclusive(lexical string, baseType Type) (Facet, error)
- func NewMinExclusive(lexical string, baseType Type) (Facet, error)
- func NewMinInclusive(lexical string, baseType Type) (Facet, error)
- type FacetTypeResolver
- type Field
- type FloatValue
- type FormChoice
- type FractionDigits
- type FundamentalFacets
- type GroupKind
- type GroupRef
- type HexBinaryValue
- type IdentityConstraint
- type IntValue
- type IntValueFacet
- type IntegerValue
- type Length
- type LengthMeasurable
- type LexicalFacet
- type LexicalValidator
- type ListType
- type LongValue
- type MaxLength
- type MinLength
- type ModelGroup
- type NamedComponent
- type NamespaceConstraint
- type NamespaceURI
- type NamespacedComponent
- type NotationDecl
- type Ordered
- type ParsedValue
- type Particle
- type ParticleHandlers
- type Pattern
- type PatternSet
- type ProcessContents
- type QName
- type RangeFacet
- type Restriction
- type SchemaComponent
- type Selector
- type ShortValue
- type SimpleContent
- type SimpleType
- func AsSimpleType(t Type) (*SimpleType, bool)
- func NewAtomicSimpleType(name QName, sourceNamespace NamespaceURI, restriction *Restriction) (*SimpleType, error)
- func NewBuiltinSimpleType(name TypeName) (*SimpleType, error)
- func NewListSimpleType(name QName, sourceNamespace NamespaceURI, list *ListType, ...) (*SimpleType, error)
- func NewPlaceholderSimpleType(name QName) *SimpleType
- func NewUnionSimpleType(name QName, sourceNamespace NamespaceURI, union *UnionType) (*SimpleType, error)
- func (s *SimpleType) BaseType() Type
- func (s *SimpleType) ComponentName() QName
- func (s *SimpleType) Copy(opts CopyOptions) *SimpleType
- func (s *SimpleType) DeclaredNamespace() NamespaceURI
- func (s *SimpleType) FundamentalFacets() *FundamentalFacets
- func (s *SimpleType) IsBuiltin() bool
- func (s *SimpleType) IsQNameOrNotationType() bool
- func (s *SimpleType) MeasureLength(lexical string) int
- func (s *SimpleType) Name() QName
- func (s *SimpleType) ParseValue(lexical string) (TypedValue, error)
- func (s *SimpleType) PrimitiveType() Type
- func (s *SimpleType) ResolvedBaseType() Type
- func (s *SimpleType) SetQNameOrNotationType(flag bool)
- func (s *SimpleType) SetWhiteSpace(ws WhiteSpace)
- func (s *SimpleType) SetWhiteSpaceExplicit(ws WhiteSpace)
- func (s *SimpleType) Validate(lexical string) error
- func (s *SimpleType) ValidateWithContext(lexical string, context map[string]string) error
- func (s *SimpleType) Variety() SimpleTypeVariety
- func (s *SimpleType) WhiteSpace() WhiteSpace
- func (s *SimpleType) WhiteSpaceExplicit() bool
- type SimpleTypeValidationOptions
- type SimpleTypeValidationScope
- type SimpleTypeVariety
- type StringTypedValue
- type StringValue
- type TotalDigits
- type Type
- func CopyType(typ Type, opts CopyOptions) Type
- func GetDerivationChain(t Type) []Type
- func IdentityListItemType(typ Type) (Type, bool)
- func IdentityMemberTypes(typ Type) []Type
- func ListItemType(typ Type) (Type, bool)
- func ListItemTypeWithResolver(typ Type, resolve func(QName) Type) (Type, bool)
- func ResolveSimpleContentBaseType(typ Type) Type
- func UnionMemberTypesWithResolver(typ Type, resolve func(QName) Type) []Type
- type TypeName
- type TypeValidator
- type TypeValidatorBytes
- type TypedValue
- func NewBase64BinaryValue(parsed ParsedValue[[]byte], typ *SimpleType) TypedValue
- func NewBooleanValue(parsed ParsedValue[bool], typ *SimpleType) TypedValue
- func NewByteValue(parsed ParsedValue[int8], typ *SimpleType) TypedValue
- func NewDateTimeValue(parsed ParsedValue[time.Time], typ *SimpleType) TypedValue
- func NewDecimalValue(parsed ParsedValue[num.Dec], typ *SimpleType) TypedValue
- func NewDoubleValue(parsed ParsedValue[float64], typ *SimpleType) TypedValue
- func NewFloatValue(parsed ParsedValue[float32], typ *SimpleType) TypedValue
- func NewHexBinaryValue(parsed ParsedValue[[]byte], typ *SimpleType) TypedValue
- func NewIntValue(parsed ParsedValue[int32], typ *SimpleType) TypedValue
- func NewIntegerValue(parsed ParsedValue[num.Int], typ *SimpleType) TypedValue
- func NewLongValue(parsed ParsedValue[int64], typ *SimpleType) TypedValue
- func NewShortValue(parsed ParsedValue[int16], typ *SimpleType) TypedValue
- func NewStringValue(parsed ParsedValue[string], typ *SimpleType) TypedValue
- func NewUnsignedByteValue(parsed ParsedValue[uint8], typ *SimpleType) TypedValue
- func NewUnsignedIntValue(parsed ParsedValue[uint32], typ *SimpleType) TypedValue
- func NewUnsignedLongValue(parsed ParsedValue[uint64], typ *SimpleType) TypedValue
- func NewUnsignedShortValue(parsed ParsedValue[uint16], typ *SimpleType) TypedValue
- func NewXSDDurationValue(parsed ParsedValue[durationlex.Duration], typ *SimpleType) TypedValue
- type UnionType
- type UnsignedByteValue
- type UnsignedIntValue
- type UnsignedLongValue
- type UnsignedShortValue
- type Unwrappable
- type ValueParserFunc
- type WhiteSpace
- type XSDDurationValue
Constants ¶
const NamespaceEmpty = qname.NamespaceEmpty
Variables ¶
var ( // ParseDecimal parses xs:decimal lexical values. ParseDecimal = parseFromBytes(value.ParseDecimal) // ParseInteger parses xs:integer lexical values. ParseInteger = parseFromBytes(value.ParseInteger) // ParseBoolean parses xs:boolean lexical values. ParseBoolean = parseFromBytes(value.ParseBoolean) // ParseFloat parses xs:float lexical values. ParseFloat = parseFromBytes(value.ParseFloat) // ParseDouble parses xs:double lexical values. ParseDouble = parseFromBytes(value.ParseDouble) // ParseDateTime parses xs:dateTime lexical values. ParseDateTime = parseFromBytes(value.ParseDateTime) // ParseLong parses xs:long lexical values. ParseLong = parseFromBytes(value.ParseLong) // ParseInt parses xs:int lexical values. ParseInt = parseFromBytes(value.ParseInt) // ParseShort parses xs:short lexical values. ParseShort = parseFromBytes(value.ParseShort) // ParseByte parses xs:byte lexical values. ParseByte = parseFromBytes(value.ParseByte) // ParseUnsignedLong parses xs:unsignedLong lexical values. ParseUnsignedLong = parseFromBytes(value.ParseUnsignedLong) // ParseUnsignedInt parses xs:unsignedInt lexical values. ParseUnsignedInt = parseFromBytes(value.ParseUnsignedInt) // ParseUnsignedShort parses xs:unsignedShort lexical values. ParseUnsignedShort = parseFromBytes(value.ParseUnsignedShort) // ParseUnsignedByte parses xs:unsignedByte lexical values. ParseUnsignedByte = parseFromBytes(value.ParseUnsignedByte) // ParseHexBinary parses xs:hexBinary lexical values. ParseHexBinary = parseFromBytes(value.ParseHexBinary) // ParseBase64Binary parses xs:base64Binary lexical values. ParseBase64Binary = parseFromBytes(value.ParseBase64Binary) // ParseAnyURI parses xs:anyURI lexical values. ParseAnyURI = parseFromBytes(value.ParseAnyURI) // ParseString returns the lexical string unchanged. ParseString = func(lexical string) (string, error) { return lexical, nil } )
var ErrCannotDeterminePrimitiveType = errors.New("cannot determine primitive type")
ErrCannotDeterminePrimitiveType is returned when the primitive type cannot be determined during parsing; schema validation handles this later.
var TrimXMLWhitespace = value.TrimXMLWhitespaceString
TrimXMLWhitespace trims XML whitespace according to the active normalization mode.
Functions ¶
func AllowsNamespace ¶
func AllowsNamespace(constraint NamespaceConstraint, list []NamespaceURI, targetNS, ns NamespaceURI) bool
AllowsNamespace reports whether a namespace is permitted by a wildcard constraint.
func ApplyWhiteSpace ¶
func ApplyWhiteSpace(lexical string, ws WhiteSpace) string
ApplyWhiteSpace applies whitespace normalization
func CompareTypedValues ¶
func CompareTypedValues(left, right TypedValue) bool
CompareTypedValues reports whether two typed values are equal in the value space.
func ElementTypesCompatible ¶
ElementTypesCompatible reports whether two element declaration types are compatible. It compares by QName when available and falls back to identity for anonymous types.
func FieldsXMLWhitespaceSeq ¶
FieldsXMLWhitespaceSeq yields fields split on XML whitespace (space, tab, CR, LF). It is equivalent to strings.FieldsSeq for XML whitespace only.
func HasTimezone ¶
HasTimezone reports whether a lexical date/time value includes a timezone indicator.
func IdentityNormalizable ¶
IdentityNormalizable reports whether typ can be normalized for identity constraints without encountering cycles.
func IsAnySimpleTypeQName ¶
IsAnySimpleTypeQName reports whether qname is xs:anySimpleType.
func IsAnyTypeQName ¶
IsAnyTypeQName reports whether qname is xs:anyType.
func IsDateTimeTypeName ¶
IsDateTimeTypeName reports whether typeName is an XSD built-in date/time type.
func IsDerivedFrom ¶
IsDerivedFrom returns true if derived is derived (directly or indirectly) from base.
func IsIntegerTypeName ¶
IsIntegerTypeName reports whether typeName is an XSD built-in integer-derived type.
func IsNumericTypeName ¶
IsNumericTypeName reports whether typeName is an XSD built-in numeric type.
func IsPlaceholderSimpleType ¶
func IsPlaceholderSimpleType(simpleType *SimpleType) bool
IsPlaceholderSimpleType reports whether simpleType represents an unresolved type reference.
func IsQNameOrNotation ¶
IsQNameOrNotation reports whether the QName is the XSD QName or NOTATION type.
func IsValidlyDerivedFrom ¶
IsValidlyDerivedFrom returns true when particle restriction rules allow the derivation. It extends IsDerivedFrom to handle unions and QName equality checks.
func NamespaceConstraintSubset ¶ added in v0.0.25
func NamespaceConstraintSubset( derivedConstraint NamespaceConstraint, derivedList []NamespaceURI, derivedTargetNS NamespaceURI, baseConstraint NamespaceConstraint, baseList []NamespaceURI, baseTargetNS NamespaceURI, ) bool
NamespaceConstraintSubset reports whether the first wildcard namespace constraint is a subset of the second constraint.
func NormalizeTypeValue ¶
NormalizeTypeValue applies model type-based lexical normalization.
func NormalizeWhiteSpace ¶
NormalizeWhiteSpace applies whitespace normalization for simple types. Non-simple types are returned unchanged.
func ParseDuration ¶
ParseDuration validates an XSD duration string and returns the lexical value. It does not map to time.Duration.
func ProcessContentsStrongerOrEqual ¶ added in v0.0.25
func ProcessContentsStrongerOrEqual(derived, base ProcessContents) bool
ProcessContentsStrongerOrEqual reports whether derived is as strict as base.
func SecondsToDuration ¶
SecondsToDuration converts a non-negative XSD seconds value to time.Duration. The conversion keeps nanosecond precision and rejects overflow.
func TimezoneKind ¶
func TimezoneKind(lexical string) value.TimezoneKind
TimezoneKind reports the timezone kind for a lexical date/time value.
func TranslateXSDPatternToGo ¶
TranslateXSDPatternToGo translates an XSD 1.0 pattern to Go regexp (RE2) syntax. Returns an error for unsupported features (fail-closed approach).
func ValidateFacetApplicability ¶
ValidateFacetApplicability checks if a facet is applicable to the base type. It returns an error that mirrors schema validation messages for inapplicable facets.
func ValidateSimpleTypeWithOptions ¶ added in v0.0.25
func ValidateSimpleTypeWithOptions(st *SimpleType, lexical string, context map[string]string, opts SimpleTypeValidationOptions) error
ValidateSimpleTypeWithOptions validates lexical input for a simple type with shared pipeline options.
func ValueAs ¶
func ValueAs[T any](typedValue TypedValue) (T, error)
ValueAs extracts the native value from a TypedValue with type safety. Returns an error if the value type doesn't match the requested type.
func WalkParticles ¶
func WalkParticles(particles []Particle, h ParticleHandlers) error
WalkParticles recursively visits all particles, calling handlers for each type.
Types ¶
type AnyAttribute ¶
type AnyAttribute struct {
TargetNamespace NamespaceURI
NamespaceList []NamespaceURI
Namespace NamespaceConstraint
ProcessContents ProcessContents
}
AnyAttribute represents an <anyAttribute> wildcard
func IntersectAnyAttribute ¶
func IntersectAnyAttribute(w1, w2 *AnyAttribute) *AnyAttribute
IntersectAnyAttribute intersects two AnyAttribute wildcards according to XSD 1.0 spec The result represents the set of namespaces that match both wildcards Returns nil if intersection is empty (no namespaces match both)
func IntersectAnyAttributeDetailed ¶
func IntersectAnyAttributeDetailed(w1, w2 *AnyAttribute) (*AnyAttribute, bool, bool)
IntersectAnyAttributeDetailed intersects two AnyAttribute wildcards and reports expressibility. If expressible is true and empty is true, the intersection is empty.
func UnionAnyAttribute ¶
func UnionAnyAttribute(w1, w2 *AnyAttribute) *AnyAttribute
UnionAnyAttribute unions two AnyAttribute wildcards according to XSD 1.0 spec (cos-aw-union) The result represents the union of namespaces that match either wildcard Returns nil if union is not expressible
type AnyElement ¶
type AnyElement struct {
TargetNamespace NamespaceURI
NamespaceList []NamespaceURI
MinOccurs occurs.Occurs
MaxOccurs occurs.Occurs
Namespace NamespaceConstraint
ProcessContents ProcessContents
}
AnyElement represents an <any> wildcard
func IntersectAnyElement ¶
func IntersectAnyElement(w1, w2 *AnyElement) *AnyElement
IntersectAnyElement intersects two AnyElement wildcards according to XSD 1.0 spec
func (*AnyElement) MaxOcc ¶
func (a *AnyElement) MaxOcc() occurs.Occurs
MaxOcc implements Particle interface
func (*AnyElement) MinOcc ¶
func (a *AnyElement) MinOcc() occurs.Occurs
MinOcc implements Particle interface
type AttributeDecl ¶
type AttributeDecl struct {
Type Type
Name QName
Default string
Fixed string
// ValueContext stores namespace bindings for resolving QName/NOTATION values in default/fixed.
ValueContext map[string]string
// FixedContext stores namespace bindings for resolving fixed QName/NOTATION values.
FixedContext map[string]string
// DefaultContext stores namespace bindings for resolving default QName/NOTATION values.
DefaultContext map[string]string
SourceNamespace NamespaceURI
Use AttributeUse
Form FormChoice
HasDefault bool
HasFixed bool
IsReference bool
}
AttributeDecl represents an attribute declaration
func NewAttributeDeclFromParsed ¶
func NewAttributeDeclFromParsed(decl *AttributeDecl) (*AttributeDecl, error)
NewAttributeDeclFromParsed validates a parsed attribute declaration and returns it if valid.
func (*AttributeDecl) ComponentName ¶
func (a *AttributeDecl) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*AttributeDecl) Copy ¶
func (a *AttributeDecl) Copy(opts CopyOptions) *AttributeDecl
Copy creates a copy of the attribute declaration with remapped QNames.
func (*AttributeDecl) DeclaredNamespace ¶
func (a *AttributeDecl) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
type AttributeGroup ¶
type AttributeGroup struct {
AnyAttribute *AnyAttribute
Name QName
SourceNamespace NamespaceURI
Attributes []*AttributeDecl
AttrGroups []QName
}
AttributeGroup represents an attribute group definition
func (*AttributeGroup) ComponentName ¶
func (g *AttributeGroup) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*AttributeGroup) Copy ¶
func (g *AttributeGroup) Copy(opts CopyOptions) *AttributeGroup
Copy creates a copy of the attribute group with remapped QNames.
func (*AttributeGroup) DeclaredNamespace ¶
func (g *AttributeGroup) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
type AttributeUse ¶
type AttributeUse int
AttributeUse represents how an attribute is used in an element declaration.
const ( // Optional indicates the attribute is optional (may be present or absent). Optional AttributeUse = iota // Required indicates the attribute must be present. Required // Prohibited indicates the attribute must not be present. Prohibited )
type Base64BinaryValue ¶
type Base64BinaryValue struct {
// contains filtered or unexported fields
}
Base64BinaryValue represents a base64Binary value.
func (*Base64BinaryValue) String ¶
func (v *Base64BinaryValue) String() string
type BooleanValue ¶
type BooleanValue struct {
// contains filtered or unexported fields
}
BooleanValue represents a boolean value
type BuiltinType ¶
type BuiltinType struct {
// contains filtered or unexported fields
}
BuiltinType represents a built-in XSD type
func AsBuiltinType ¶
func AsBuiltinType(t Type) (*BuiltinType, bool)
AsBuiltinType performs a type assertion to *BuiltinType.
func BuiltinTypes ¶ added in v0.0.25
func BuiltinTypes() []*BuiltinType
BuiltinTypes returns built-in XSD types in deterministic order.
func (*BuiltinType) BaseType ¶
func (b *BuiltinType) BaseType() Type
BaseType returns the base type for this built-in type
func (*BuiltinType) FundamentalFacets ¶
func (b *BuiltinType) FundamentalFacets() *FundamentalFacets
FundamentalFacets returns the fundamental facets for this built-in type
func (*BuiltinType) HasByteValidator ¶
func (b *BuiltinType) HasByteValidator() bool
HasByteValidator reports whether this type provides a byte validator.
func (*BuiltinType) IsBuiltin ¶
func (b *BuiltinType) IsBuiltin() bool
IsBuiltin returns true for built-in types
func (*BuiltinType) MeasureLength ¶
func (b *BuiltinType) MeasureLength(value string) int
MeasureLength returns length in type-appropriate units (octets, items, or characters). Implements LengthMeasurable interface.
func (*BuiltinType) Ordered ¶
func (b *BuiltinType) Ordered() bool
Ordered returns whether this type has an order relation
func (*BuiltinType) ParseValue ¶
func (b *BuiltinType) ParseValue(lexical string) (TypedValue, error)
ParseValue converts a lexical value to a TypedValue
func (*BuiltinType) PrimitiveType ¶
func (b *BuiltinType) PrimitiveType() Type
PrimitiveType returns the primitive type for this built-in type
func (*BuiltinType) ResolvedBaseType ¶
func (b *BuiltinType) ResolvedBaseType() Type
ResolvedBaseType returns the resolved base type, or nil if at root. Implements DerivedType interface.
func (*BuiltinType) Validate ¶
func (b *BuiltinType) Validate(value string) error
Validate validates a value against this type
func (*BuiltinType) ValidateBytes ¶
func (b *BuiltinType) ValidateBytes(value []byte) (bool, error)
ValidateBytes validates a byte slice value when a byte validator exists. It returns false when no byte validator is configured.
func (*BuiltinType) Variety ¶
func (b *BuiltinType) Variety() SimpleTypeVariety
Variety returns the simple type variety (all built-in types are atomic)
func (*BuiltinType) WhiteSpace ¶
func (b *BuiltinType) WhiteSpace() WhiteSpace
WhiteSpace returns the whitespace normalization for this type
type ByteValue ¶
type ByteValue struct {
// contains filtered or unexported fields
}
ByteValue represents a byte value
type Cardinality ¶
type Cardinality int
Cardinality represents the cardinality facet value.
const ( // CardinalityFinite indicates a finite value space. CardinalityFinite Cardinality = iota // CardinalityCountablyInfinite indicates a countably infinite value space. CardinalityCountablyInfinite // CardinalityUncountablyInfinite indicates an uncountably infinite value space. CardinalityUncountablyInfinite )
type ComparableDec ¶
ComparableDec wraps num.Dec to implement ComparableValue.
func (ComparableDec) Compare ¶
func (c ComparableDec) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue.
func (ComparableDec) String ¶
func (c ComparableDec) String() string
String returns the canonical string representation.
func (ComparableDec) Type ¶
func (c ComparableDec) Type() Type
Type returns the XSD type represented by the value.
func (ComparableDec) Unwrap ¶
func (c ComparableDec) Unwrap() any
Unwrap returns the inner num.Dec value.
type ComparableDuration ¶
ComparableDuration wraps time.Duration to implement ComparableValue Note: Durations are partially ordered, so comparison is limited to pure day/time durations
func (ComparableDuration) Compare ¶
func (c ComparableDuration) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue (implements ComparableValue) Both durations must be pure day/time durations (no years/months)
func (ComparableDuration) String ¶
func (c ComparableDuration) String() string
String returns the string representation (implements ComparableValue)
func (ComparableDuration) Type ¶
func (c ComparableDuration) Type() Type
Type returns the XSD type (implements ComparableValue)
func (ComparableDuration) Unwrap ¶
func (c ComparableDuration) Unwrap() any
Unwrap returns the inner time.Duration value
type ComparableFloat32 ¶
ComparableFloat32 wraps float32 to implement ComparableValue with NaN/INF handling.
func (ComparableFloat32) Compare ¶
func (c ComparableFloat32) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue.
func (ComparableFloat32) String ¶
func (c ComparableFloat32) String() string
String returns the string representation.
func (ComparableFloat32) Type ¶
func (c ComparableFloat32) Type() Type
Type returns the XSD type represented by the value.
func (ComparableFloat32) Unwrap ¶
func (c ComparableFloat32) Unwrap() any
Unwrap returns the inner float32 value.
type ComparableFloat64 ¶
ComparableFloat64 wraps float64 to implement ComparableValue with NaN/INF handling.
func (ComparableFloat64) Compare ¶
func (c ComparableFloat64) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue.
func (ComparableFloat64) String ¶
func (c ComparableFloat64) String() string
String returns the string representation.
func (ComparableFloat64) Type ¶
func (c ComparableFloat64) Type() Type
Type returns the XSD type represented by the value.
func (ComparableFloat64) Unwrap ¶
func (c ComparableFloat64) Unwrap() any
Unwrap returns the inner float64 value.
type ComparableInt ¶
ComparableInt wraps num.Int to implement ComparableValue.
func (ComparableInt) Compare ¶
func (c ComparableInt) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue.
func (ComparableInt) String ¶
func (c ComparableInt) String() string
String returns the canonical string representation.
func (ComparableInt) Type ¶
func (c ComparableInt) Type() Type
Type returns the XSD type represented by the value.
func (ComparableInt) Unwrap ¶
func (c ComparableInt) Unwrap() any
Unwrap returns the inner num.Int value.
type ComparableTime ¶
type ComparableTime struct {
Value time.Time
// XSD type this value represents
Typ Type
TimezoneKind value.TimezoneKind
Kind temporal.Kind
LeapSecond bool
}
ComparableTime wraps time.Time to implement ComparableValue
func (ComparableTime) Compare ¶
func (c ComparableTime) Compare(other ComparableValue) (int, error)
Compare compares with another ComparableValue (implements ComparableValue)
func (ComparableTime) String ¶
func (c ComparableTime) String() string
String returns the string representation (implements ComparableValue)
func (ComparableTime) Type ¶
func (c ComparableTime) Type() Type
Type returns the XSD type (implements ComparableValue)
func (ComparableTime) Unwrap ¶
func (c ComparableTime) Unwrap() any
Unwrap returns the inner time.Time value
type ComparableValue ¶
type ComparableValue interface {
Compare(other ComparableValue) (int, error)
String() string
Type() Type
}
ComparableValue is a unified interface for comparable values.
type ComparableXSDDuration ¶
type ComparableXSDDuration struct {
Typ Type
Value durationlex.Duration
}
ComparableXSDDuration wraps durationlex.Duration to implement ComparableValue This supports full XSD durations including years and months
func (ComparableXSDDuration) Compare ¶
func (c ComparableXSDDuration) Compare(other ComparableValue) (int, error)
Compare orders durations using the XSD 1.0 order relation for duration.
func (ComparableXSDDuration) String ¶
func (c ComparableXSDDuration) String() string
String returns the string representation (implements ComparableValue)
func (ComparableXSDDuration) Type ¶
func (c ComparableXSDDuration) Type() Type
Type returns the XSD type (implements ComparableValue)
func (ComparableXSDDuration) Unwrap ¶
func (c ComparableXSDDuration) Unwrap() any
Unwrap returns the inner duration value
type ComplexContent ¶
type ComplexContent struct {
Extension *Extension
Restriction *Restriction
Base QName
Mixed bool
// MixedSpecified reports whether mixed was explicitly set on complexContent.
MixedSpecified bool
}
ComplexContent represents complex content
func (*ComplexContent) BaseTypeQName ¶
func (c *ComplexContent) BaseTypeQName() QName
BaseTypeQName returns the base type QName from Extension or Restriction.
func (*ComplexContent) Copy ¶
func (c *ComplexContent) Copy(opts CopyOptions) Content
Copy creates a copy of the complex content with remapped QNames.
func (*ComplexContent) ExtensionDef ¶
func (c *ComplexContent) ExtensionDef() *Extension
ExtensionDef returns the extension if present.
func (*ComplexContent) RestrictionDef ¶
func (c *ComplexContent) RestrictionDef() *Restriction
RestrictionDef returns the restriction if present.
type ComplexType ¶
type ComplexType struct {
ResolvedBase Type
QName QName
SourceNamespace NamespaceURI
AttrGroups []QName
Final DerivationSet
Block DerivationSet
DerivationMethod DerivationMethod
Abstract bool
// contains filtered or unexported fields
}
ComplexType represents a complex type definition
func AsComplexType ¶
func AsComplexType(t Type) (*ComplexType, bool)
AsComplexType performs a type assertion to *ComplexType.
func NewAnyTypeComplexType ¶
func NewAnyTypeComplexType() *ComplexType
NewAnyTypeComplexType creates a complex type definition for xs:anyType.
func NewComplexType ¶
func NewComplexType(name QName, sourceNamespace NamespaceURI) *ComplexType
NewComplexType creates a new complex type with the provided name and namespace.
func NewComplexTypeFromParsed ¶
func NewComplexTypeFromParsed(ct *ComplexType) (*ComplexType, error)
NewComplexTypeFromParsed validates a parsed complex type and returns it if valid.
func (*ComplexType) AnyAttribute ¶
func (c *ComplexType) AnyAttribute() *AnyAttribute
AnyAttribute returns the wildcard attribute if present.
func (*ComplexType) Attributes ¶
func (c *ComplexType) Attributes() []*AttributeDecl
Attributes returns the attribute declarations.
func (*ComplexType) BaseType ¶
func (c *ComplexType) BaseType() Type
BaseType returns the base type for this complex type If ResolvedBase is nil, returns anyType (the base of all types)
func (*ComplexType) ComponentName ¶
func (c *ComplexType) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*ComplexType) Content ¶
func (c *ComplexType) Content() Content
Content returns the content model.
func (*ComplexType) Copy ¶
func (c *ComplexType) Copy(opts CopyOptions) *ComplexType
Copy creates a copy of the complex type with remapped QNames.
func (*ComplexType) DeclaredNamespace ¶
func (c *ComplexType) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
func (*ComplexType) EffectiveMixed ¶
func (c *ComplexType) EffectiveMixed() bool
EffectiveMixed returns the mixed value after applying complexContent overrides.
func (*ComplexType) FundamentalFacets ¶
func (c *ComplexType) FundamentalFacets() *FundamentalFacets
FundamentalFacets returns the fundamental facets for this complex type Complex types don't have fundamental facets, so this always returns nil
func (*ComplexType) IsBuiltin ¶
func (c *ComplexType) IsBuiltin() bool
IsBuiltin reports whether the complex type is built-in.
func (*ComplexType) IsDerived ¶
func (c *ComplexType) IsDerived() bool
IsDerived returns true if this complex type is derived (has a derivation method)
func (*ComplexType) IsExtension ¶
func (c *ComplexType) IsExtension() bool
IsExtension returns true if this complex type is derived by extension
func (*ComplexType) IsRestriction ¶
func (c *ComplexType) IsRestriction() bool
IsRestriction returns true if this complex type is derived by restriction
func (*ComplexType) Mixed ¶
func (c *ComplexType) Mixed() bool
Mixed returns true if this type allows mixed content.
func (*ComplexType) Name ¶
func (c *ComplexType) Name() QName
Name returns the QName of the complex type.
func (*ComplexType) PrimitiveType ¶
func (c *ComplexType) PrimitiveType() Type
PrimitiveType returns the primitive type for this complex type Complex types don't have primitive types, so this always returns nil
func (*ComplexType) ResolvedBaseType ¶
func (c *ComplexType) ResolvedBaseType() Type
ResolvedBaseType returns the resolved base type, or nil if at root. Implements DerivedType interface.
func (*ComplexType) SetAnyAttribute ¶
func (c *ComplexType) SetAnyAttribute(anyAttr *AnyAttribute)
SetAnyAttribute sets the wildcard attribute
func (*ComplexType) SetAttributes ¶
func (c *ComplexType) SetAttributes(attributes []*AttributeDecl)
SetAttributes sets the attribute declarations
func (*ComplexType) SetContent ¶
func (c *ComplexType) SetContent(content Content)
SetContent sets the content model
func (*ComplexType) SetMixed ¶
func (c *ComplexType) SetMixed(mixed bool)
SetMixed sets whether this type allows mixed content
func (*ComplexType) WhiteSpace ¶
func (c *ComplexType) WhiteSpace() WhiteSpace
WhiteSpace returns the whitespace normalization for this complex type. Complex types do not define whiteSpace, so this returns WhiteSpacePreserve.
type ConstraintType ¶
type ConstraintType int
ConstraintType represents the type of identity constraint
const ( // UniqueConstraint indicates an xs:unique constraint. UniqueConstraint ConstraintType = iota // KeyConstraint indicates an xs:key constraint. KeyConstraint // KeyRefConstraint indicates an xs:keyref constraint. KeyRefConstraint )
func (ConstraintType) String ¶
func (c ConstraintType) String() string
String returns the string representation of the constraint type
type Content ¶
type Content interface {
BaseTypeQName() QName
ExtensionDef() *Extension
RestrictionDef() *Restriction
Copy(opts CopyOptions) Content
// contains filtered or unexported methods
}
Content represents element content. SimpleContent and ComplexContent return derivation info; others return nil.
type CopyOptions ¶
type CopyOptions struct {
RemapQName func(QName) QName
SourceNamespace NamespaceURI
PreserveSourceNamespace bool
// contains filtered or unexported fields
}
CopyOptions configures how schema components are copied during merge.
func WithGraphMemo ¶
func WithGraphMemo(opts CopyOptions) CopyOptions
WithGraphMemo enables cycle-safe graph copy memoization for copy operations.
type DateTimeValue ¶
type DateTimeValue struct {
// contains filtered or unexported fields
}
DateTimeValue represents a dateTime value
func (*DateTimeValue) String ¶
func (v *DateTimeValue) String() string
type DecimalValue ¶
type DecimalValue struct {
// contains filtered or unexported fields
}
DecimalValue represents a decimal value
func (*DecimalValue) String ¶
func (v *DecimalValue) String() string
type DeferredFacet ¶
DeferredFacet stores raw facet data when the base type is not available during parsing. These facets are validated during schema validation when the base type is resolved.
type DeferredFacetConverter ¶ added in v0.0.25
type DeferredFacetConverter func(df *DeferredFacet, baseType Type) (Facet, error)
DeferredFacetConverter converts deferred facets once base type is known.
type DerivationMethod ¶
type DerivationMethod int
DerivationMethod represents a derivation method
const ( // DerivationExtension indicates derivation by extension. DerivationExtension DerivationMethod = 1 << iota // DerivationRestriction indicates derivation by restriction. DerivationRestriction // DerivationList indicates derivation by list. DerivationList // DerivationUnion indicates derivation by union. DerivationUnion // DerivationSubstitution indicates derivation by substitution. DerivationSubstitution )
type DerivationSet ¶
type DerivationSet int
DerivationSet represents a set of derivation methods
func (DerivationSet) Add ¶
func (d DerivationSet) Add(method DerivationMethod) DerivationSet
Add adds a derivation method to the set
func (DerivationSet) Has ¶
func (d DerivationSet) Has(method DerivationMethod) bool
Has checks if a derivation method is in the set
type DerivedType ¶
type DerivedType interface {
Type
// ResolvedBaseType returns the resolved base type, or nil if at root.
ResolvedBaseType() Type
}
DerivedType is implemented by types that can be derived from a base type.
func AsDerivedType ¶
func AsDerivedType(t Type) (DerivedType, bool)
AsDerivedType performs a type assertion to DerivedType.
type DoubleValue ¶
type DoubleValue struct {
// contains filtered or unexported fields
}
DoubleValue represents a double value
func (*DoubleValue) String ¶
func (v *DoubleValue) String() string
type ElementContent ¶
type ElementContent struct {
Particle Particle
}
ElementContent represents element-only or mixed content
func (*ElementContent) BaseTypeQName ¶
func (e *ElementContent) BaseTypeQName() QName
BaseTypeQName returns an empty base QName for element content.
func (*ElementContent) Copy ¶
func (e *ElementContent) Copy(opts CopyOptions) Content
Copy creates a copy of the element content with remapped particles.
func (*ElementContent) ExtensionDef ¶
func (e *ElementContent) ExtensionDef() *Extension
ExtensionDef returns nil for element content.
func (*ElementContent) RestrictionDef ¶
func (e *ElementContent) RestrictionDef() *Restriction
RestrictionDef returns nil for element content.
type ElementDecl ¶
type ElementDecl struct {
Type Type
ValueContext map[string]string
FixedContext map[string]string
DefaultContext map[string]string
Name QName
SubstitutionGroup QName
SourceNamespace NamespaceURI
Fixed string
Default string
Constraints []*IdentityConstraint
MinOccurs occurs.Occurs
MaxOccurs occurs.Occurs
Final DerivationSet
Block DerivationSet
Form FormChoice
TypeExplicit bool
HasDefault bool
Abstract bool
Nillable bool
HasFixed bool
IsReference bool
}
ElementDecl represents an element declaration
func NewElementDeclFromParsed ¶
func NewElementDeclFromParsed(decl *ElementDecl) (*ElementDecl, error)
NewElementDeclFromParsed validates a parsed element declaration and returns it if valid.
func (*ElementDecl) ComponentName ¶
func (e *ElementDecl) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*ElementDecl) Copy ¶
func (e *ElementDecl) Copy(opts CopyOptions) *ElementDecl
Copy creates a copy of the element declaration with remapped QNames.
func (*ElementDecl) DeclaredNamespace ¶
func (e *ElementDecl) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
func (*ElementDecl) MaxOcc ¶
func (e *ElementDecl) MaxOcc() occurs.Occurs
MaxOcc implements Particle interface
func (*ElementDecl) MinOcc ¶
func (e *ElementDecl) MinOcc() occurs.Occurs
MinOcc implements Particle interface
type EmptyContent ¶
type EmptyContent struct{}
EmptyContent represents empty content
func (*EmptyContent) BaseTypeQName ¶
func (e *EmptyContent) BaseTypeQName() QName
BaseTypeQName returns an empty base QName for empty content.
func (*EmptyContent) Copy ¶
func (e *EmptyContent) Copy(_ CopyOptions) Content
Copy creates a copy of the empty content.
func (*EmptyContent) ExtensionDef ¶
func (e *EmptyContent) ExtensionDef() *Extension
ExtensionDef returns nil for empty content.
func (*EmptyContent) RestrictionDef ¶
func (e *EmptyContent) RestrictionDef() *Restriction
RestrictionDef returns nil for empty content.
type Enumeration ¶
type Enumeration struct {
// contains filtered or unexported fields
}
Enumeration validates the xs:enumeration facet across atomic, list, and union types.
func NewEnumeration ¶
func NewEnumeration(values []string) *Enumeration
NewEnumeration creates an enumeration facet with immutable values.
func (*Enumeration) AppendValue ¶
func (e *Enumeration) AppendValue(value string, context map[string]string)
AppendValue adds a value and optional namespace context during schema parsing.
func (*Enumeration) QNameValues ¶
func (e *Enumeration) QNameValues() []QName
QNameValues returns resolved QName values for QName/NOTATION enumerations.
func (*Enumeration) ResolveQNameValues ¶
func (e *Enumeration) ResolveQNameValues() ([]QName, error)
ResolveQNameValues parses enumeration values as QNames using ValueContexts. It returns a QName for each entry in Values or an error if any value cannot be resolved.
func (*Enumeration) SetQNameValues ¶
func (e *Enumeration) SetQNameValues(values []QName)
SetQNameValues stores resolved QName values for QName/NOTATION enumerations.
func (*Enumeration) SetValueContexts ¶
func (e *Enumeration) SetValueContexts(values []map[string]string)
SetValueContexts stores namespace contexts aligned with Values.
func (*Enumeration) Validate ¶
func (e *Enumeration) Validate(value TypedValue, baseType Type) error
Validate checks if the value is in the enumeration (unified Facet interface)
func (*Enumeration) ValidateLexical ¶
func (e *Enumeration) ValidateLexical(lexical string, baseType Type) error
ValidateLexical checks if the lexical value is in the enumeration.
func (*Enumeration) ValidateLexicalQName ¶
func (e *Enumeration) ValidateLexicalQName(lexical string, baseType Type, context map[string]string) error
ValidateLexicalQName validates QName/NOTATION enumerations using namespace context.
func (*Enumeration) ValueContexts ¶
func (e *Enumeration) ValueContexts() []map[string]string
ValueContexts returns namespace contexts aligned with Values.
func (*Enumeration) Values ¶
func (e *Enumeration) Values() []string
Values returns a copy of the enumeration values.
type Extension ¶
type Extension struct {
Particle Particle
AnyAttribute *AnyAttribute
Base QName
Attributes []*AttributeDecl
AttrGroups []QName
}
Extension represents a type extension
type Facet ¶
type Facet interface {
Name() string
Validate(value TypedValue, baseType Type) error
}
Facet is the unified interface for all constraining facets
func CollectRestrictionFacetsWithResolver ¶ added in v0.0.25
func CollectRestrictionFacetsWithResolver(restriction *Restriction, baseType Type, resolve FacetTypeResolver, convert DeferredFacetConverter) ([]Facet, error)
CollectRestrictionFacetsWithResolver collects restriction facets and composes same-step patterns.
func CollectSimpleTypeFacetsWithResolver ¶ added in v0.0.25
func CollectSimpleTypeFacetsWithResolver(st *SimpleType, resolve FacetTypeResolver, convert DeferredFacetConverter) ([]Facet, error)
CollectSimpleTypeFacetsWithResolver collects inherited and local simple-type facets.
func NewMaxExclusive ¶
NewMaxExclusive creates a maxExclusive facet based on the base type.
func NewMaxInclusive ¶
NewMaxInclusive creates a maxInclusive facet based on the base type.
func NewMinExclusive ¶
NewMinExclusive creates a minExclusive facet based on the base type.
type FacetTypeResolver ¶ added in v0.0.25
FacetTypeResolver resolves simple type QNames for facet inheritance.
type FloatValue ¶
type FloatValue struct {
// contains filtered or unexported fields
}
FloatValue represents a float value
func (*FloatValue) String ¶
func (v *FloatValue) String() string
type FormChoice ¶
type FormChoice int
FormChoice represents the form attribute value for element/attribute declarations.
const ( // FormDefault uses the schema's elementFormDefault/attributeFormDefault setting. FormDefault FormChoice = iota // FormQualified requires the element/attribute to be in the target namespace. FormQualified // FormUnqualified requires the element/attribute to be in no namespace. FormUnqualified )
type FractionDigits ¶
type FractionDigits struct {
Value int
}
FractionDigits represents a fractionDigits facet
func (*FractionDigits) GetIntValue ¶
func (f *FractionDigits) GetIntValue() int
GetIntValue returns the integer value (implements IntValueFacet)
func (*FractionDigits) Validate ¶
func (f *FractionDigits) Validate(value TypedValue, baseType Type) error
Validate checks if the number of fractional digits doesn't exceed the limit (unified Facet interface)
func (*FractionDigits) ValidateLexical ¶
func (f *FractionDigits) ValidateLexical(lexical string, _ Type) error
ValidateLexical checks if the lexical value respects fractionDigits.
type FundamentalFacets ¶
type FundamentalFacets struct {
Ordered Ordered
Cardinality Cardinality
Bounded bool
Numeric bool
}
FundamentalFacets represents the fundamental facets of a simple type
func ComputeFundamentalFacets ¶
func ComputeFundamentalFacets(typeName TypeName) *FundamentalFacets
ComputeFundamentalFacets computes fundamental facets for a primitive type
type GroupKind ¶
type GroupKind int
GroupKind represents the kind of model group in XSD content models.
type GroupRef ¶
GroupRef represents a placeholder for a group reference that will be resolved later This allows forward references and references to groups in imported schemas
type HexBinaryValue ¶
type HexBinaryValue struct {
// contains filtered or unexported fields
}
HexBinaryValue represents a hexBinary value.
func (*HexBinaryValue) String ¶
func (v *HexBinaryValue) String() string
type IdentityConstraint ¶
type IdentityConstraint struct {
NamespaceContext map[string]string
ReferQName QName
Name string
TargetNamespace NamespaceURI
Selector Selector
Fields []Field
Type ConstraintType
}
IdentityConstraint represents key, keyref, or unique constraints
type IntValue ¶
type IntValue struct {
// contains filtered or unexported fields
}
IntValue represents an int value
type IntValueFacet ¶
IntValueFacet is a facet that has an integer value. Examples include length, minLength, maxLength, totalDigits, and fractionDigits facets.
type IntegerValue ¶
type IntegerValue struct {
// contains filtered or unexported fields
}
IntegerValue represents an integer value
func (*IntegerValue) String ¶
func (v *IntegerValue) String() string
type Length ¶
type Length struct {
Value int
}
Length represents a length facet
func (*Length) GetIntValue ¶
GetIntValue returns the integer value (implements IntValueFacet)
type LengthMeasurable ¶
type LengthMeasurable interface {
Type
// MeasureLength returns length in type-appropriate units (octets, items, or characters).
MeasureLength(value string) int
}
LengthMeasurable types know how to measure their length for facet schemacheck.
type LexicalFacet ¶
LexicalFacet is a facet that has a lexical string value. Examples include pattern and enumeration facets.
type LexicalValidator ¶
LexicalValidator validates a lexical value without a TypedValue.
type ListType ¶
type ListType struct {
InlineItemType *SimpleType
ItemType QName
}
ListType represents a list type
type LongValue ¶
type LongValue struct {
// contains filtered or unexported fields
}
LongValue represents a long value
type MaxLength ¶
type MaxLength struct {
Value int
}
MaxLength represents a maxLength facet
func (*MaxLength) GetIntValue ¶
GetIntValue returns the integer value (implements IntValueFacet)
type MinLength ¶
type MinLength struct {
Value int
}
MinLength represents a minLength facet
func (*MinLength) GetIntValue ¶
GetIntValue returns the integer value (implements IntValueFacet)
type ModelGroup ¶
type ModelGroup struct {
SourceNamespace NamespaceURI
Particles []Particle
MinOccurs occurs.Occurs
MaxOccurs occurs.Occurs
Kind GroupKind
}
ModelGroup represents sequence, choice, or all groups.
func CloneModelGroupTree ¶
func CloneModelGroupTree(group *ModelGroup) *ModelGroup
CloneModelGroupTree clones model-group structure recursively. Non-model-group particles are reused by pointer.
func (*ModelGroup) Copy ¶
func (m *ModelGroup) Copy(opts CopyOptions) *ModelGroup
Copy creates a copy of the model group with remapped QNames.
func (*ModelGroup) MaxOcc ¶
func (m *ModelGroup) MaxOcc() occurs.Occurs
MaxOcc implements Particle interface
func (*ModelGroup) MinOcc ¶
func (m *ModelGroup) MinOcc() occurs.Occurs
MinOcc implements Particle interface
type NamedComponent ¶
type NamedComponent interface {
// ComponentName returns the QName of this component.
ComponentName() QName
}
NamedComponent exposes the component name without namespace details.
type NamespaceConstraint ¶
type NamespaceConstraint int
NamespaceConstraint represents a namespace constraint
const ( // NSCAny allows any namespace. NSCAny NamespaceConstraint = iota // NSCOther allows any namespace except the target namespace. NSCOther // NSCTargetNamespace allows only the target namespace. NSCTargetNamespace // NSCLocal allows only no-namespace. NSCLocal // NSCList allows an explicit namespace list. NSCList // NSCNotAbsent allows any namespace-qualified name (excludes no-namespace). NSCNotAbsent )
const NSCInvalid NamespaceConstraint = -1
NSCInvalid represents an invalid namespace constraint.
type NamespaceURI ¶
type NamespaceURI = qname.NamespaceURI
NamespaceURI is an alias of qname.NamespaceURI.
const NamespaceTargetPlaceholder NamespaceURI = "##targetNamespace"
NamespaceTargetPlaceholder marks a namespace list entry that represents ##targetNamespace. It is resolved against the wildcard's TargetNamespace at validation time.
const XMLNamespace NamespaceURI = NamespaceURI(xmlnames.XMLNamespace)
XMLNamespace is the XML namespace URI.
const XSDNamespace NamespaceURI = "http://www.w3.org/2001/XMLSchema"
XSDNamespace is the XML Schema namespace URI.
type NamespacedComponent ¶
type NamespacedComponent interface {
// DeclaredNamespace returns the targetNamespace where this component was declared.
DeclaredNamespace() NamespaceURI
}
NamespacedComponent exposes the declared namespace for a component.
type NotationDecl ¶
type NotationDecl struct {
Name QName
// public identifier (optional)
Public string
// system identifier (optional)
System string
// targetNamespace of the schema where this notation was originally declared
SourceNamespace NamespaceURI
}
NotationDecl represents a notation declaration
func (*NotationDecl) ComponentName ¶
func (n *NotationDecl) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*NotationDecl) Copy ¶
func (n *NotationDecl) Copy(opts CopyOptions) *NotationDecl
Copy creates a copy of the notation declaration with remapped QNames.
func (*NotationDecl) DeclaredNamespace ¶
func (n *NotationDecl) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
type ParsedValue ¶
ParsedValue captures a normalized lexical value and its parsed native form.
func NewParsedValue ¶
func NewParsedValue[T any](lexical string, native T) ParsedValue[T]
NewParsedValue constructs a ParsedValue from lexical and native values.
type ParticleHandlers ¶
type ParticleHandlers struct {
OnElement func(*ElementDecl) error
OnGroup func(*ModelGroup) error
OnWildcard func(*AnyElement) error
OnGroupRef func(*GroupRef) error
}
ParticleHandlers contains optional handler functions for particle traversal. Nil handlers are skipped.
type Pattern ¶
Pattern represents a pattern facet (regex)
func (*Pattern) Validate ¶
func (p *Pattern) Validate(value TypedValue, _ Type) error
Validate checks if the value matches the pattern
func (*Pattern) ValidateLexical ¶
ValidateLexical validates a lexical value against the pattern.
func (*Pattern) ValidateSyntax ¶
ValidateSyntax validates that the pattern value is a valid XSD regex pattern and translates it to Go regex. This should be called during schema schemacheck.
type PatternSet ¶
type PatternSet struct {
// All patterns from the same derivation step
Patterns []*Pattern
}
PatternSet groups multiple patterns from the same derivation step. Per XSD spec, patterns from the same step are ORed together.
func (*PatternSet) Validate ¶
func (ps *PatternSet) Validate(value TypedValue, _ Type) error
Validate checks if the value matches ANY pattern in the set (OR semantics)
func (*PatternSet) ValidateLexical ¶
func (ps *PatternSet) ValidateLexical(lexical string, _ Type) error
ValidateLexical validates a lexical value against a pattern set.
func (*PatternSet) ValidateSyntax ¶
func (ps *PatternSet) ValidateSyntax() error
ValidateSyntax validates all patterns in the set
type ProcessContents ¶
type ProcessContents int
ProcessContents defines how to process wildcard elements
const ( // Strict requires validation against a declaration. Strict ProcessContents = iota // Lax validates only if a declaration is found. Lax Skip )
type QName ¶
QName is an alias of qname.QName.
func AnySimpleTypeQName ¶
func AnySimpleTypeQName() QName
AnySimpleTypeQName returns the canonical QName for xs:anySimpleType.
func AnyTypeQName ¶
func AnyTypeQName() QName
AnyTypeQName returns the canonical QName for xs:anyType.
type RangeFacet ¶
type RangeFacet struct {
// contains filtered or unexported fields
}
RangeFacet validates min/max inclusive/exclusive bounds for comparable values.
func (*RangeFacet) GetLexical ¶
func (r *RangeFacet) GetLexical() string
GetLexical returns the lexical value (implements LexicalFacet)
func (*RangeFacet) Validate ¶
func (r *RangeFacet) Validate(value TypedValue, baseType Type) error
Validate validates a TypedValue using ComparableValue comparison
type Restriction ¶
type Restriction struct {
Particle Particle
AnyAttribute *AnyAttribute
SimpleType *SimpleType
Base QName
Facets []any
Attributes []*AttributeDecl
AttrGroups []QName
}
Restriction represents a type restriction
type SchemaComponent ¶
type SchemaComponent interface {
NamedComponent
NamespacedComponent
}
SchemaComponent is implemented by any named component in a schema.
type Selector ¶
type Selector struct {
XPath string
}
Selector represents a selector XPath expression
type ShortValue ¶
type ShortValue struct {
// contains filtered or unexported fields
}
ShortValue represents a short value
type SimpleContent ¶
type SimpleContent struct {
Extension *Extension
Restriction *Restriction
Base QName
}
SimpleContent represents simple content in a complex type
func (*SimpleContent) BaseTypeQName ¶
func (s *SimpleContent) BaseTypeQName() QName
BaseTypeQName returns the base type QName from Extension or Restriction.
func (*SimpleContent) Copy ¶
func (s *SimpleContent) Copy(opts CopyOptions) Content
Copy creates a copy of the simple content with remapped QNames.
func (*SimpleContent) ExtensionDef ¶
func (s *SimpleContent) ExtensionDef() *Extension
ExtensionDef returns the extension if present.
func (*SimpleContent) RestrictionDef ¶
func (s *SimpleContent) RestrictionDef() *Restriction
RestrictionDef returns the restriction if present.
type SimpleType ¶
type SimpleType struct {
ResolvedBase Type
ItemType Type
Restriction *Restriction
List *ListType
Union *UnionType
QName QName
SourceNamespace NamespaceURI
MemberTypes []Type
Final DerivationSet
// contains filtered or unexported fields
}
SimpleType represents a simple type definition
func AsSimpleType ¶
func AsSimpleType(t Type) (*SimpleType, bool)
AsSimpleType performs a type assertion to *SimpleType.
func NewAtomicSimpleType ¶
func NewAtomicSimpleType(name QName, sourceNamespace NamespaceURI, restriction *Restriction) (*SimpleType, error)
NewAtomicSimpleType creates a simple type derived by restriction.
func NewBuiltinSimpleType ¶
func NewBuiltinSimpleType(name TypeName) (*SimpleType, error)
NewBuiltinSimpleType creates a SimpleType wrapper for a built-in type name.
func NewListSimpleType ¶
func NewListSimpleType(name QName, sourceNamespace NamespaceURI, list *ListType, restriction *Restriction) (*SimpleType, error)
NewListSimpleType creates a simple type derived by list.
func NewPlaceholderSimpleType ¶
func NewPlaceholderSimpleType(name QName) *SimpleType
NewPlaceholderSimpleType creates a simple type placeholder for unresolved references.
func NewUnionSimpleType ¶
func NewUnionSimpleType(name QName, sourceNamespace NamespaceURI, union *UnionType) (*SimpleType, error)
NewUnionSimpleType creates a simple type derived by union.
func (*SimpleType) BaseType ¶
func (s *SimpleType) BaseType() Type
BaseType returns the base type for this simple type If ResolvedBase is nil, returns anySimpleType (the base of all simple types)
func (*SimpleType) ComponentName ¶
func (s *SimpleType) ComponentName() QName
ComponentName returns the QName of this component. Implements SchemaComponent interface.
func (*SimpleType) Copy ¶
func (s *SimpleType) Copy(opts CopyOptions) *SimpleType
Copy creates a copy of the simple type with remapped QNames.
func (*SimpleType) DeclaredNamespace ¶
func (s *SimpleType) DeclaredNamespace() NamespaceURI
DeclaredNamespace returns the targetNamespace where this component was declared. Implements SchemaComponent interface.
func (*SimpleType) FundamentalFacets ¶
func (s *SimpleType) FundamentalFacets() *FundamentalFacets
FundamentalFacets returns the fundamental facets for this simple type
func (*SimpleType) IsBuiltin ¶
func (s *SimpleType) IsBuiltin() bool
IsBuiltin reports whether the simple type is built-in.
func (*SimpleType) IsQNameOrNotationType ¶
func (s *SimpleType) IsQNameOrNotationType() bool
IsQNameOrNotationType reports whether this type derives from QName or NOTATION.
func (*SimpleType) MeasureLength ¶
func (s *SimpleType) MeasureLength(lexical string) int
MeasureLength returns length in type-appropriate units (octets, items, or characters). Implements LengthMeasurable interface.
func (*SimpleType) Name ¶
func (s *SimpleType) Name() QName
Name returns the QName of the simple type.
func (*SimpleType) ParseValue ¶
func (s *SimpleType) ParseValue(lexical string) (TypedValue, error)
ParseValue converts a lexical value to a TypedValue.
func (*SimpleType) PrimitiveType ¶
func (s *SimpleType) PrimitiveType() Type
PrimitiveType returns the ultimate primitive base type for this simple type.
func (*SimpleType) ResolvedBaseType ¶
func (s *SimpleType) ResolvedBaseType() Type
ResolvedBaseType returns the resolved base type, or nil if at root. Implements DerivedType interface.
func (*SimpleType) SetQNameOrNotationType ¶
func (s *SimpleType) SetQNameOrNotationType(flag bool)
SetQNameOrNotationType stores the precomputed QName/NOTATION derivation flag.
func (*SimpleType) SetWhiteSpace ¶
func (s *SimpleType) SetWhiteSpace(ws WhiteSpace)
SetWhiteSpace sets the whitespace normalization for this simple type
func (*SimpleType) SetWhiteSpaceExplicit ¶
func (s *SimpleType) SetWhiteSpaceExplicit(ws WhiteSpace)
SetWhiteSpaceExplicit sets the whitespace normalization and marks it as explicitly set. This is used when parsing a whiteSpace facet in a restriction.
func (*SimpleType) Validate ¶
func (s *SimpleType) Validate(lexical string) error
Validate validates lexical against this simple type.
func (*SimpleType) ValidateWithContext ¶
func (s *SimpleType) ValidateWithContext(lexical string, context map[string]string) error
ValidateWithContext checks if a lexical value is valid for this type using namespace context.
func (*SimpleType) Variety ¶
func (s *SimpleType) Variety() SimpleTypeVariety
Variety returns the simple type variety.
func (*SimpleType) WhiteSpace ¶
func (s *SimpleType) WhiteSpace() WhiteSpace
WhiteSpace returns the whitespace normalization for this simple type
func (*SimpleType) WhiteSpaceExplicit ¶
func (s *SimpleType) WhiteSpaceExplicit() bool
WhiteSpaceExplicit returns true if whiteSpace was explicitly set in this type's restriction.
type SimpleTypeValidationOptions ¶ added in v0.0.25
type SimpleTypeValidationOptions struct {
CycleError error
ResolveListItem func(*SimpleType) Type
ResolveUnionMembers func(*SimpleType) []Type
ResolveFacetType FacetTypeResolver
ConvertDeferredFacets DeferredFacetConverter
ValidateFacets func(normalized string, st *SimpleType, context map[string]string) error
UnionNoMatch func(st *SimpleType, normalized string, firstErr error, sawCycle bool) error
ListItemErr func(st *SimpleType, err error, isCycle bool) error
ValidateType func(typ Type, scope SimpleTypeValidationScope) error
RequireQNameContext bool
ValidationScope SimpleTypeValidationScope
}
SimpleTypeValidationOptions configures shared simple-type validation behavior.
type SimpleTypeValidationScope ¶ added in v0.0.25
type SimpleTypeValidationScope uint8
SimpleTypeValidationScope identifies how type validation reached a nested type.
const ( SimpleTypeValidationScopeRoot SimpleTypeValidationScope = iota SimpleTypeValidationScopeListItem SimpleTypeValidationScopeUnionMember )
type SimpleTypeVariety ¶
type SimpleTypeVariety int
SimpleTypeVariety represents the variety of a simple type.
const ( // AtomicVariety indicates an atomic simple type (derived by restriction). AtomicVariety SimpleTypeVariety = iota // ListVariety indicates a list simple type (derived by list). ListVariety // UnionVariety indicates a union simple type (derived by union). UnionVariety )
func (SimpleTypeVariety) String ¶
func (v SimpleTypeVariety) String() string
type StringTypedValue ¶
StringTypedValue is a simple TypedValue wrapper for string values Used when parsing to native type fails but we still need to validate facets
func (*StringTypedValue) Lexical ¶
func (s *StringTypedValue) Lexical() string
Lexical returns the raw lexical value used when parsing fails.
func (*StringTypedValue) Native ¶
func (s *StringTypedValue) Native() any
Native returns the lexical value as its native representation.
func (*StringTypedValue) String ¶
func (s *StringTypedValue) String() string
String returns the lexical value for error messages.
func (*StringTypedValue) Type ¶
func (s *StringTypedValue) Type() Type
Type returns the XSD type used for facet checks.
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
StringValue represents a string value
type TotalDigits ¶
type TotalDigits struct {
Value int
}
TotalDigits validates the xs:totalDigits facet.
func (*TotalDigits) GetIntValue ¶
func (t *TotalDigits) GetIntValue() int
GetIntValue returns the integer value (implements IntValueFacet)
func (*TotalDigits) Validate ¶
func (t *TotalDigits) Validate(value TypedValue, baseType Type) error
Validate checks if the total number of digits doesn't exceed the limit (unified Facet interface)
func (*TotalDigits) ValidateLexical ¶
func (t *TotalDigits) ValidateLexical(lexical string, _ Type) error
ValidateLexical checks if the lexical value respects totalDigits.
type Type ¶
type Type interface {
Name() QName
IsBuiltin() bool
BaseType() Type
PrimitiveType() Type
FundamentalFacets() *FundamentalFacets
WhiteSpace() WhiteSpace
}
Type represents an XSD type (simple or complex)
func CopyType ¶
func CopyType(typ Type, opts CopyOptions) Type
CopyType creates a copy of a type with remapped QNames. Used for chameleon includes where type references need to be remapped to the target namespace.
func GetDerivationChain ¶
GetDerivationChain returns the chain of base types from t to its ultimate base. Returns an empty slice for primitive types or types without base types.
func IdentityListItemType ¶
IdentityListItemType returns the resolved list item type for identity normalization. It returns false when typ is not a list type or has no resolvable item type.
func IdentityMemberTypes ¶
IdentityMemberTypes returns the union member types eligible for identity normalization.
func ListItemType ¶
ListItemType returns the item type for list simple types. It resolves built-in list types and list derivations, returning false when the item type cannot be determined.
func ListItemTypeWithResolver ¶
ListItemTypeWithResolver returns the item type for list simple types. The resolver can resolve non-builtin QNames when list definitions are referenced through named base types.
func ResolveSimpleContentBaseType ¶
ResolveSimpleContentBaseType returns the first non-simpleContent base type.
func UnionMemberTypesWithResolver ¶
UnionMemberTypesWithResolver returns flattened member types for union simple types. The resolver can resolve non-builtin QNames from union memberTypes attributes and named restriction bases.
type TypeName ¶
type TypeName string
TypeName represents the local name of an XSD type Using a typed string prevents mixing type names with other strings
const ( // Complex type TypeNameAnyType TypeName = "anyType" // Base simple type (base of all simple types) TypeNameAnySimpleType TypeName = "anySimpleType" // Primitive types (19 total) TypeNameString TypeName = "string" TypeNameBoolean TypeName = "boolean" TypeNameDecimal TypeName = "decimal" TypeNameFloat TypeName = "float" TypeNameDouble TypeName = "double" TypeNameDuration TypeName = "duration" TypeNameDateTime TypeName = "dateTime" TypeNameTime TypeName = "time" TypeNameDate TypeName = "date" TypeNameGYearMonth TypeName = "gYearMonth" TypeNameGYear TypeName = "gYear" TypeNameGMonthDay TypeName = "gMonthDay" TypeNameGDay TypeName = "gDay" TypeNameGMonth TypeName = "gMonth" TypeNameHexBinary TypeName = "hexBinary" TypeNameBase64Binary TypeName = "base64Binary" TypeNameAnyURI TypeName = "anyURI" TypeNameQName TypeName = "QName" TypeNameNOTATION TypeName = "NOTATION" // Derived string types TypeNameNormalizedString TypeName = "normalizedString" TypeNameToken TypeName = "token" TypeNameLanguage TypeName = "language" TypeNameName TypeName = "Name" TypeNameNCName TypeName = "NCName" TypeNameID TypeName = "ID" TypeNameIDREF TypeName = "IDREF" TypeNameIDREFS TypeName = "IDREFS" TypeNameENTITY TypeName = "ENTITY" TypeNameENTITIES TypeName = "ENTITIES" TypeNameNMTOKEN TypeName = "NMTOKEN" TypeNameNMTOKENS TypeName = "NMTOKENS" // Derived numeric types TypeNameInteger TypeName = "integer" TypeNameLong TypeName = "long" TypeNameInt TypeName = "int" TypeNameShort TypeName = "short" TypeNameByte TypeName = "byte" TypeNameNonNegativeInteger TypeName = "nonNegativeInteger" TypeNamePositiveInteger TypeName = "positiveInteger" TypeNameUnsignedLong TypeName = "unsignedLong" TypeNameUnsignedInt TypeName = "unsignedInt" TypeNameUnsignedShort TypeName = "unsignedShort" TypeNameUnsignedByte TypeName = "unsignedByte" TypeNameNegativeInteger TypeName = "negativeInteger" TypeNameNonPositiveInteger TypeName = "nonPositiveInteger" )
Built-in XSD type name constants
type TypeValidator ¶
TypeValidator validates a string value according to a type's rules. It is used to implement validation logic for built-in XSD types. Returns an error if the value is invalid, nil otherwise.
type TypeValidatorBytes ¶
TypeValidatorBytes validates a byte slice value according to a type's rules. It avoids allocations when values are already in byte form.
type TypedValue ¶
type TypedValue interface {
// Type returns the XSD type this value belongs to
Type() Type
// Lexical returns the original lexical representation
Lexical() string
// Native returns the native Go type representation
Native() any
// String returns a canonical string representation
String() string
}
TypedValue represents a value with its XSD type It stores both the original lexical representation (for error messages, PSVI) and the parsed native Go type (for efficient validation)
func NewBase64BinaryValue ¶
func NewBase64BinaryValue(parsed ParsedValue[[]byte], typ *SimpleType) TypedValue
NewBase64BinaryValue creates a new Base64BinaryValue.
func NewBooleanValue ¶
func NewBooleanValue(parsed ParsedValue[bool], typ *SimpleType) TypedValue
NewBooleanValue creates a new BooleanValue
func NewByteValue ¶
func NewByteValue(parsed ParsedValue[int8], typ *SimpleType) TypedValue
NewByteValue creates a new ByteValue
func NewDateTimeValue ¶
func NewDateTimeValue(parsed ParsedValue[time.Time], typ *SimpleType) TypedValue
NewDateTimeValue creates a new DateTimeValue
func NewDecimalValue ¶
func NewDecimalValue(parsed ParsedValue[num.Dec], typ *SimpleType) TypedValue
NewDecimalValue creates a new DecimalValue
func NewDoubleValue ¶
func NewDoubleValue(parsed ParsedValue[float64], typ *SimpleType) TypedValue
NewDoubleValue creates a new DoubleValue
func NewFloatValue ¶
func NewFloatValue(parsed ParsedValue[float32], typ *SimpleType) TypedValue
NewFloatValue creates a new FloatValue
func NewHexBinaryValue ¶
func NewHexBinaryValue(parsed ParsedValue[[]byte], typ *SimpleType) TypedValue
NewHexBinaryValue creates a new HexBinaryValue.
func NewIntValue ¶
func NewIntValue(parsed ParsedValue[int32], typ *SimpleType) TypedValue
NewIntValue creates a new IntValue
func NewIntegerValue ¶
func NewIntegerValue(parsed ParsedValue[num.Int], typ *SimpleType) TypedValue
NewIntegerValue creates a new IntegerValue
func NewLongValue ¶
func NewLongValue(parsed ParsedValue[int64], typ *SimpleType) TypedValue
NewLongValue creates a new LongValue
func NewShortValue ¶
func NewShortValue(parsed ParsedValue[int16], typ *SimpleType) TypedValue
NewShortValue creates a new ShortValue
func NewStringValue ¶
func NewStringValue(parsed ParsedValue[string], typ *SimpleType) TypedValue
NewStringValue creates a new StringValue
func NewUnsignedByteValue ¶
func NewUnsignedByteValue(parsed ParsedValue[uint8], typ *SimpleType) TypedValue
NewUnsignedByteValue creates a new UnsignedByteValue
func NewUnsignedIntValue ¶
func NewUnsignedIntValue(parsed ParsedValue[uint32], typ *SimpleType) TypedValue
NewUnsignedIntValue creates a new UnsignedIntValue
func NewUnsignedLongValue ¶
func NewUnsignedLongValue(parsed ParsedValue[uint64], typ *SimpleType) TypedValue
NewUnsignedLongValue creates a new UnsignedLongValue
func NewUnsignedShortValue ¶
func NewUnsignedShortValue(parsed ParsedValue[uint16], typ *SimpleType) TypedValue
NewUnsignedShortValue creates a new UnsignedShortValue
func NewXSDDurationValue ¶
func NewXSDDurationValue(parsed ParsedValue[durationlex.Duration], typ *SimpleType) TypedValue
NewXSDDurationValue creates a new XSDDurationValue.
type UnionType ¶
type UnionType struct {
// From memberTypes attribute (QNames to resolve)
MemberTypes []QName
// From inline <simpleType> children (already parsed)
InlineTypes []*SimpleType
}
UnionType represents a union type
type UnsignedByteValue ¶
type UnsignedByteValue struct {
// contains filtered or unexported fields
}
UnsignedByteValue represents an unsignedByte value
type UnsignedIntValue ¶
type UnsignedIntValue struct {
// contains filtered or unexported fields
}
UnsignedIntValue represents an unsignedInt value
type UnsignedLongValue ¶
type UnsignedLongValue struct {
// contains filtered or unexported fields
}
UnsignedLongValue represents an unsignedLong value
type UnsignedShortValue ¶
type UnsignedShortValue struct {
// contains filtered or unexported fields
}
UnsignedShortValue represents an unsignedShort value
type Unwrappable ¶
type Unwrappable interface {
Unwrap() any
}
Unwrappable is an interface for types that can unwrap their inner value.
type ValueParserFunc ¶
type ValueParserFunc func(lexical string, typ Type) (TypedValue, error)
ValueParserFunc parses a lexical value and returns a TypedValue. The typ parameter is the type that should be used in the resulting TypedValue.
type WhiteSpace ¶
type WhiteSpace int
WhiteSpace represents whitespace normalization
const ( WhiteSpacePreserve WhiteSpace = iota WhiteSpaceReplace WhiteSpaceCollapse )
type XSDDurationValue ¶
type XSDDurationValue struct {
// contains filtered or unexported fields
}
XSDDurationValue represents a duration value.
func (*XSDDurationValue) String ¶
func (v *XSDDurationValue) String() string
Source Files
¶
- anytype.go
- builtin.go
- builtin_registry.go
- builtin_validators.go
- builtin_validators_bytes.go
- cache_guard.go
- comparable_numeric.go
- comparable_temporal.go
- comparable_time_duration.go
- complex_type.go
- components.go
- copy.go
- datetime.go
- derivation.go
- derived.go
- doc.go
- facet.go
- facet_applicability.go
- facet_parse.go
- facet_pattern_facets.go
- facet_pattern_translator_charclass.go
- facet_pattern_translator_core.go
- facet_pattern_translator_escape.go
- facet_pattern_translator_helpers.go
- facet_validators_common.go
- facet_validators_digits.go
- facet_validators_enumeration.go
- facet_validators_length.go
- facet_validators_range.go
- fundamental.go
- group.go
- group_clone.go
- identity_normalization.go
- list_builtin.go
- list_helpers.go
- names.go
- parser_registry.go
- simple_content.go
- simple_type_core.go
- simple_type_facets_collect.go
- simple_type_pipeline.go
- simple_type_primitive.go
- simple_type_validation.go
- type.go
- type_compatibility.go
- type_helpers.go
- type_name_classification.go
- type_resolution_helpers.go
- value_compare.go
- value_parsers.go
- values.go
- walk.go
- whitespace.go
- wildcard.go