Package eu.maveniverse.domtrip
Class NamespaceResolver
java.lang.Object
eu.maveniverse.domtrip.NamespaceResolver
Utility class for resolving namespace information in XML elements.
Provides methods to resolve namespace URIs, prefixes, and build namespace contexts.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NamespaceContextbuildNamespaceContext(Element element) Builds a complete namespace context for the given element.static StringcreateQualifiedName(String prefix, String localName) Creates a qualified name from prefix and local name.static booleanisNamespaceInScope(Element element, String namespaceURI) Checks if a namespace URI is in scope for the given element.static StringresolveNamespaceURI(Element element, String prefix) Resolves the namespace URI for a given prefix in the context of an element.static StringresolvePrefix(Element element, String namespaceURI) Resolves a prefix for a given namespace URI in the context of an element.static String[]splitQualifiedName(String qualifiedName) Splits a qualified name into prefix and local name parts.
-
Method Details
-
resolveNamespaceURI
Resolves the namespace URI for a given prefix in the context of an element. Walks up the element tree to find namespace declarations. -
resolvePrefix
Resolves a prefix for a given namespace URI in the context of an element. Returns the first prefix found that maps to the URI. -
isNamespaceInScope
Checks if a namespace URI is in scope for the given element. -
buildNamespaceContext
Builds a complete namespace context for the given element. Includes all namespace declarations from the element and its ancestors. -
splitQualifiedName
Splits a qualified name into prefix and local name parts. Returns an array where [0] is prefix (or null) and [1] is local name. -
createQualifiedName
Creates a qualified name from prefix and local name.
-