model

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package model defines the XSD schema model and shared type-system structures.

Index

Constants

View Source
const NamespaceEmpty = qname.NamespaceEmpty

Variables

View Source
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
	}
)
View Source
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.

View Source
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

func ElementTypesCompatible(a, b Type) bool

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

func FieldsXMLWhitespaceSeq(lexical string) iter.Seq[string]

FieldsXMLWhitespaceSeq yields fields split on XML whitespace (space, tab, CR, LF). It is equivalent to strings.FieldsSeq for XML whitespace only.

func HasTimezone

func HasTimezone(lexical string) bool

HasTimezone reports whether a lexical date/time value includes a timezone indicator.

func IdentityNormalizable

func IdentityNormalizable(typ Type) bool

IdentityNormalizable reports whether typ can be normalized for identity constraints without encountering cycles.

func IsAnySimpleTypeQName

func IsAnySimpleTypeQName(qname QName) bool

IsAnySimpleTypeQName reports whether qname is xs:anySimpleType.

func IsAnyTypeQName

func IsAnyTypeQName(qname QName) bool

IsAnyTypeQName reports whether qname is xs:anyType.

func IsDateTimeTypeName

func IsDateTimeTypeName(typeName string) bool

IsDateTimeTypeName reports whether typeName is an XSD built-in date/time type.

func IsDerivedFrom

func IsDerivedFrom(derived, base Type) bool

IsDerivedFrom returns true if derived is derived (directly or indirectly) from base.

func IsIntegerTypeName

func IsIntegerTypeName(typeName string) bool

IsIntegerTypeName reports whether typeName is an XSD built-in integer-derived type.

func IsNumericTypeName

func IsNumericTypeName(typeName string) bool

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

func IsQNameOrNotation(name QName) bool

IsQNameOrNotation reports whether the QName is the XSD QName or NOTATION type.

func IsValidlyDerivedFrom

func IsValidlyDerivedFrom(derived, base Type) bool

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

func NormalizeTypeValue(lexical string, typ Type) (string, error)

NormalizeTypeValue applies model type-based lexical normalization.

func NormalizeWhiteSpace

func NormalizeWhiteSpace(lexical string, typ Type) string

NormalizeWhiteSpace applies whitespace normalization for simple types. Non-simple types are returned unchanged.

func ParseDuration

func ParseDuration(lexical string) (string, error)

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

func SecondsToDuration(sec num.Dec) (time.Duration, error)

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

func TranslateXSDPatternToGo(xsdPattern string) (string, error)

TranslateXSDPatternToGo translates an XSD 1.0 pattern to Go regexp (RE2) syntax. Returns an error for unsupported features (fail-closed approach).

func ValidateFacetApplicability

func ValidateFacetApplicability(facetName string, baseType Type, baseQName QName) error

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) Lexical

func (v *Base64BinaryValue) Lexical() string

func (*Base64BinaryValue) Native

func (v *Base64BinaryValue) Native() any

func (*Base64BinaryValue) String

func (v *Base64BinaryValue) String() string

func (*Base64BinaryValue) Type

func (v *Base64BinaryValue) Type() Type

type BooleanValue

type BooleanValue struct {
	// contains filtered or unexported fields
}

BooleanValue represents a boolean value

func (*BooleanValue) Lexical

func (v *BooleanValue) Lexical() string

func (*BooleanValue) Native

func (v *BooleanValue) Native() any

func (*BooleanValue) String

func (v *BooleanValue) String() string

func (*BooleanValue) Type

func (v *BooleanValue) Type() Type

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) Name

func (b *BuiltinType) Name() QName

Name returns the type name as a QName

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

func (*ByteValue) Lexical

func (v *ByteValue) Lexical() string

func (*ByteValue) Native

func (v *ByteValue) Native() any

func (*ByteValue) String

func (v *ByteValue) String() string

func (*ByteValue) Type

func (v *ByteValue) Type() Type

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

type ComparableDec struct {
	Typ   Type
	Value num.Dec
}

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

type ComparableDuration struct {
	Typ   Type
	Value time.Duration
}

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

type ComparableFloat32 struct {
	Typ   Type
	Value float32
}

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

type ComparableFloat64 struct {
	Typ   Type
	Value float64
}

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

type ComparableInt struct {
	Typ   Type
	Value num.Int
}

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) Lexical

func (v *DateTimeValue) Lexical() string

func (*DateTimeValue) Native

func (v *DateTimeValue) Native() any

func (*DateTimeValue) String

func (v *DateTimeValue) String() string

func (*DateTimeValue) Type

func (v *DateTimeValue) Type() Type

type DecimalValue

type DecimalValue struct {
	// contains filtered or unexported fields
}

DecimalValue represents a decimal value

func (*DecimalValue) Lexical

func (v *DecimalValue) Lexical() string

func (*DecimalValue) Native

func (v *DecimalValue) Native() any

func (*DecimalValue) String

func (v *DecimalValue) String() string

func (*DecimalValue) Type

func (v *DecimalValue) Type() Type

type DeferredFacet

type DeferredFacet struct {
	FacetName  string
	FacetValue string
}

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

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) Lexical

func (v *DoubleValue) Lexical() string

func (*DoubleValue) Native

func (v *DoubleValue) Native() any

func (*DoubleValue) String

func (v *DoubleValue) String() string

func (*DoubleValue) Type

func (v *DoubleValue) Type() Type

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) Name

func (e *Enumeration) Name() string

Name returns the facet name

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) Seal

func (e *Enumeration) Seal()

Seal marks the enumeration as immutable.

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

func NewMaxExclusive(lexical string, baseType Type) (Facet, error)

NewMaxExclusive creates a maxExclusive facet based on the base type.

func NewMaxInclusive

func NewMaxInclusive(lexical string, baseType Type) (Facet, error)

NewMaxInclusive creates a maxInclusive facet based on the base type.

func NewMinExclusive

func NewMinExclusive(lexical string, baseType Type) (Facet, error)

NewMinExclusive creates a minExclusive facet based on the base type.

func NewMinInclusive

func NewMinInclusive(lexical string, baseType Type) (Facet, error)

NewMinInclusive creates a minInclusive facet based on the base type.

type FacetTypeResolver added in v0.0.25

type FacetTypeResolver func(QName) Type

FacetTypeResolver resolves simple type QNames for facet inheritance.

type Field

type Field struct {
	Type         Type
	ResolvedType Type
	XPath        string
}

Field represents a field XPath expression

type FloatValue

type FloatValue struct {
	// contains filtered or unexported fields
}

FloatValue represents a float value

func (*FloatValue) Lexical

func (v *FloatValue) Lexical() string

func (*FloatValue) Native

func (v *FloatValue) Native() any

func (*FloatValue) String

func (v *FloatValue) String() string

func (*FloatValue) Type

func (v *FloatValue) Type() Type

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) Name

func (f *FractionDigits) Name() string

Name returns the facet name

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.

const (
	// Sequence indicates elements must appear in the specified order.
	Sequence GroupKind = iota
	// Choice indicates exactly one of the elements must appear.
	Choice
	// AllGroup indicates all elements may appear in any order, each at most once.
	AllGroup
)

type GroupRef

type GroupRef struct {
	RefQName  QName
	MinOccurs occurs.Occurs
	MaxOccurs occurs.Occurs
}

GroupRef represents a placeholder for a group reference that will be resolved later This allows forward references and references to groups in imported schemas

func (*GroupRef) MaxOcc

func (g *GroupRef) MaxOcc() occurs.Occurs

MaxOcc implements Particle interface

func (*GroupRef) MinOcc

func (g *GroupRef) MinOcc() occurs.Occurs

MinOcc implements Particle interface

type HexBinaryValue

type HexBinaryValue struct {
	// contains filtered or unexported fields
}

HexBinaryValue represents a hexBinary value.

func (*HexBinaryValue) Lexical

func (v *HexBinaryValue) Lexical() string

func (*HexBinaryValue) Native

func (v *HexBinaryValue) Native() any

func (*HexBinaryValue) String

func (v *HexBinaryValue) String() string

func (*HexBinaryValue) Type

func (v *HexBinaryValue) Type() Type

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

func (*IntValue) Lexical

func (v *IntValue) Lexical() string

func (*IntValue) Native

func (v *IntValue) Native() any

func (*IntValue) String

func (v *IntValue) String() string

func (*IntValue) Type

func (v *IntValue) Type() Type

type IntValueFacet

type IntValueFacet interface {
	Facet
	GetIntValue() int
}

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) Lexical

func (v *IntegerValue) Lexical() string

func (*IntegerValue) Native

func (v *IntegerValue) Native() any

func (*IntegerValue) String

func (v *IntegerValue) String() string

func (*IntegerValue) Type

func (v *IntegerValue) Type() Type

type Length

type Length struct {
	Value int
}

Length represents a length facet

func (*Length) GetIntValue

func (l *Length) GetIntValue() int

GetIntValue returns the integer value (implements IntValueFacet)

func (*Length) Name

func (l *Length) Name() string

Name returns the facet name

func (*Length) Validate

func (l *Length) Validate(value TypedValue, baseType Type) error

Validate checks if the value has the exact length (unified Facet interface)

func (*Length) ValidateLexical

func (l *Length) ValidateLexical(lexical string, baseType Type) error

ValidateLexical checks if the lexical value has the exact length.

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

type LexicalFacet interface {
	Facet
	GetLexical() string
}

LexicalFacet is a facet that has a lexical string value. Examples include pattern and enumeration facets.

type LexicalValidator

type LexicalValidator interface {
	Facet
	ValidateLexical(lexical string, baseType Type) error
}

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

func (*LongValue) Lexical

func (v *LongValue) Lexical() string

func (*LongValue) Native

func (v *LongValue) Native() any

func (*LongValue) String

func (v *LongValue) String() string

func (*LongValue) Type

func (v *LongValue) Type() Type

type MaxLength

type MaxLength struct {
	Value int
}

MaxLength represents a maxLength facet

func (*MaxLength) GetIntValue

func (m *MaxLength) GetIntValue() int

GetIntValue returns the integer value (implements IntValueFacet)

func (*MaxLength) Name

func (m *MaxLength) Name() string

Name returns the facet name

func (*MaxLength) Validate

func (m *MaxLength) Validate(value TypedValue, baseType Type) error

Validate checks if the value meets maximum length (unified Facet interface)

func (*MaxLength) ValidateLexical

func (m *MaxLength) ValidateLexical(lexical string, baseType Type) error

ValidateLexical checks if the lexical value meets maximum length.

type MinLength

type MinLength struct {
	Value int
}

MinLength represents a minLength facet

func (*MinLength) GetIntValue

func (m *MinLength) GetIntValue() int

GetIntValue returns the integer value (implements IntValueFacet)

func (*MinLength) Name

func (m *MinLength) Name() string

Name returns the facet name

func (*MinLength) Validate

func (m *MinLength) Validate(value TypedValue, baseType Type) error

Validate checks if the value meets minimum length (unified Facet interface)

func (*MinLength) ValidateLexical

func (m *MinLength) ValidateLexical(lexical string, baseType Type) error

ValidateLexical checks if the lexical value meets minimum length.

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.

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 Ordered

type Ordered int

Ordered represents the ordered facet value

const (
	// OrderedNone indicates no ordering.
	OrderedNone Ordered = iota
	// OrderedPartial indicates partial ordering.
	OrderedPartial
	// OrderedTotal indicates total ordering.
	OrderedTotal
)

func (Ordered) String

func (o Ordered) String() string

String returns the string form of the ordered facet.

type ParsedValue

type ParsedValue[T any] struct {
	Native  T
	Lexical string
}

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 Particle

type Particle interface {
	MinOcc() occurs.Occurs
	MaxOcc() occurs.Occurs
}

Particle represents a content model particle

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

type Pattern struct {
	Value     string
	GoPattern string
	// contains filtered or unexported fields
}

Pattern represents a pattern facet (regex)

func (*Pattern) Name

func (p *Pattern) Name() string

Name returns the facet name

func (*Pattern) Validate

func (p *Pattern) Validate(value TypedValue, _ Type) error

Validate checks if the value matches the pattern

func (*Pattern) ValidateLexical

func (p *Pattern) ValidateLexical(lexical string, _ Type) error

ValidateLexical validates a lexical value against the pattern.

func (*Pattern) ValidateSyntax

func (p *Pattern) ValidateSyntax() error

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) Name

func (ps *PatternSet) Name() string

Name returns the facet name

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

type QName = qname.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.

func NilRemap

func NilRemap(qname QName) QName

NilRemap returns qname unchanged (for non-chameleon merges)

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) Name

func (r *RangeFacet) Name() string

Name returns the facet name

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

func (*ShortValue) Lexical

func (v *ShortValue) Lexical() string

func (*ShortValue) Native

func (v *ShortValue) Native() any

func (*ShortValue) String

func (v *ShortValue) String() string

func (*ShortValue) Type

func (v *ShortValue) Type() Type

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

type StringTypedValue struct {
	Typ   Type
	Value string
}

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

func (*StringValue) Lexical

func (v *StringValue) Lexical() string

func (*StringValue) Native

func (v *StringValue) Native() any

func (*StringValue) String

func (v *StringValue) String() string

func (*StringValue) Type

func (v *StringValue) Type() Type

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) Name

func (t *TotalDigits) Name() string

Name returns the facet name

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

func GetDerivationChain(t Type) []Type

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

func IdentityListItemType(typ Type) (Type, bool)

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

func IdentityMemberTypes(typ Type) []Type

IdentityMemberTypes returns the union member types eligible for identity normalization.

func ListItemType

func ListItemType(typ Type) (Type, bool)

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

func ListItemTypeWithResolver(typ Type, resolve func(QName) Type) (Type, bool)

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

func ResolveSimpleContentBaseType(typ Type) Type

ResolveSimpleContentBaseType returns the first non-simpleContent base type.

func UnionMemberTypesWithResolver

func UnionMemberTypesWithResolver(typ Type, resolve func(QName) Type) []Type

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

func (TypeName) String

func (tn TypeName) String() string

String returns the string representation of the type name

type TypeValidator

type TypeValidator func(value string) error

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

type TypeValidatorBytes func(value []byte) error

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

func (*UnsignedByteValue) Lexical

func (v *UnsignedByteValue) Lexical() string

func (*UnsignedByteValue) Native

func (v *UnsignedByteValue) Native() any

func (*UnsignedByteValue) String

func (v *UnsignedByteValue) String() string

func (*UnsignedByteValue) Type

func (v *UnsignedByteValue) Type() Type

type UnsignedIntValue

type UnsignedIntValue struct {
	// contains filtered or unexported fields
}

UnsignedIntValue represents an unsignedInt value

func (*UnsignedIntValue) Lexical

func (v *UnsignedIntValue) Lexical() string

func (*UnsignedIntValue) Native

func (v *UnsignedIntValue) Native() any

func (*UnsignedIntValue) String

func (v *UnsignedIntValue) String() string

func (*UnsignedIntValue) Type

func (v *UnsignedIntValue) Type() Type

type UnsignedLongValue

type UnsignedLongValue struct {
	// contains filtered or unexported fields
}

UnsignedLongValue represents an unsignedLong value

func (*UnsignedLongValue) Lexical

func (v *UnsignedLongValue) Lexical() string

func (*UnsignedLongValue) Native

func (v *UnsignedLongValue) Native() any

func (*UnsignedLongValue) String

func (v *UnsignedLongValue) String() string

func (*UnsignedLongValue) Type

func (v *UnsignedLongValue) Type() Type

type UnsignedShortValue

type UnsignedShortValue struct {
	// contains filtered or unexported fields
}

UnsignedShortValue represents an unsignedShort value

func (*UnsignedShortValue) Lexical

func (v *UnsignedShortValue) Lexical() string

func (*UnsignedShortValue) Native

func (v *UnsignedShortValue) Native() any

func (*UnsignedShortValue) String

func (v *UnsignedShortValue) String() string

func (*UnsignedShortValue) Type

func (v *UnsignedShortValue) Type() Type

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) Lexical

func (v *XSDDurationValue) Lexical() string

func (*XSDDurationValue) Native

func (v *XSDDurationValue) Native() any

func (*XSDDurationValue) String

func (v *XSDDurationValue) String() string

func (*XSDDurationValue) Type

func (v *XSDDurationValue) Type() Type

Jump to

Keyboard shortcuts

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