Documentation
¶
Overview ¶
Package qname provides deterministic QName ordering helpers.
Index ¶
- func Compare(a, b QName) int
- func IsValidNCName(s string) bool
- func IsValidQName(s string) bool
- func ParseQName(name string) (prefix, local string, hasPrefix bool, err error)
- func SortInPlace(names []QName)
- func SplitQName(name string) (prefix, local string, hasPrefix bool)
- type NamespaceURI
- type QName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidNCName ¶
IsValidNCName returns true if the string is a valid NCName.
func IsValidQName ¶
IsValidQName returns true if the string is a valid QName.
func ParseQName ¶
ParseQName trims and validates a QName, returning prefix/local parts.
func SortInPlace ¶ added in v0.0.25
func SortInPlace(names []QName)
SortInPlace sorts QNames by namespace then local name.
func SplitQName ¶
SplitQName splits a QName string into prefix/local without validation.
Types ¶
type NamespaceURI ¶
type NamespaceURI = string
NamespaceURI represents a namespace URI.
const NamespaceEmpty NamespaceURI = ""
NamespaceEmpty represents an empty namespace URI (no namespace).
func ResolveNamespace ¶
func ResolveNamespace(prefix string, context map[string]string) (NamespaceURI, bool)
ResolveNamespace looks up a prefix in a namespace context map.
type QName ¶
type QName struct {
Namespace NamespaceURI
Local string
}
QName represents a qualified name with namespace and local part.
func ParseQNameValue ¶ added in v0.0.24
ParseQNameValue parses a QName lexical value with namespace resolution.
func SortAndDedupe ¶ added in v0.0.25
SortAndDedupe sorts QNames and removes duplicates in place.
func SortedMapKeys ¶ added in v0.0.25
SortedMapKeys returns map keys in deterministic QName order.
func (QName) HasLocal ¶ added in v0.0.24
HasLocal reports whether the local name matches, ignoring namespace.
func (QName) Is ¶ added in v0.0.24
Is reports whether the QName matches the namespace and local name.