xsd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseDatatypes []byte

BaseDatatypes is the XML Schema definition from https://www.w3.org/2001/XMLSchema.xsd

Functions

func GetTargetNamespace

func GetTargetNamespace(schemaDoc *xmlquery.Node) string

GetTargetNamespace gets the target namespace from the schema document

func InheritNamespaces

func InheritNamespaces(node *xmlquery.Node)

InheritNamespaces adds namespace prefixes to the schema if they are missing traversing up the parent nodes until the root

func MakeQName

func MakeQName(prefix, localPart string) string

MakeQName creates a qualified name from a prefix and local part

func SplitQName

func SplitQName(qname string) (namespace, localPart string)

SplitQName splits a qualified name into namespace and local part

Types

type Schema

type Schema struct {
	TargetNamespace string

	// FilePath is the local path of the schema
	FilePath string
}

Schema represents an XSD schema

type SchemaSystem

type SchemaSystem interface {
	// GetSchemas returns a map of schema URLs to schema metadata
	GetSchemas() map[string]Schema

	// GetSchemasWithTargetNamespace returns a slice of schemas with the given target namespace
	GetSchemasWithTargetNamespace(targetNamespace string) []Schema

	// ResolveElement resolves an element by QName
	ResolveElement(qname string) (*xml.Name, error)

	// ResolveType resolves a type by QName
	ResolveType(qname string) (*xml.Name, error)

	// ImportSchema imports a schema into the schema system
	ImportSchema(wsdlDir string, uniqueSchemaFilename string, schemaContent []byte) error
}

SchemaSystem is an interface for resolving schema elements and types

func ExtractSchemas

func ExtractSchemas(wsdlPath string, wsdlDoc *xmlquery.Node) (SchemaSystem, error)

ExtractSchemas extracts schemas from a WSDL document and returns a schema system

Jump to

Keyboard shortcuts

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