Package com.luna.common.xml
Class XmlUtil.UniversalNamespaceCache
java.lang.Object
com.luna.common.xml.XmlUtil.UniversalNamespaceCache
- All Implemented Interfaces:
NamespaceContext
- Enclosing class:
- XmlUtil
全局命名空间上下文
见:https://www.ibm.com/developerworks/cn/xml/x-nmspccontext/
见:https://www.ibm.com/developerworks/cn/xml/x-nmspccontext/
-
Constructor Summary
ConstructorDescriptionUniversalNamespaceCache
(Node node, boolean toplevelOnly) This constructor parses the document and stores all namespaces it can find. -
Method Summary
Modifier and TypeMethodDescriptiongetNamespaceURI
(String prefix) This method is called by XPath.This method is not needed in this context, but can be implemented in a similar way.getPrefixes
(String namespaceURI)
-
Constructor Details
-
UniversalNamespaceCache
This constructor parses the document and stores all namespaces it can find. If toplevelOnly is true, only namespaces in the root are used.- Parameters:
node
- source NodetoplevelOnly
- restriction of the search to enhance performance
-
-
Method Details
-
getNamespaceURI
This method is called by XPath. It returns the default namespace, if the prefix is null or "".- Specified by:
getNamespaceURI
in interfaceNamespaceContext
- Parameters:
prefix
- to search for- Returns:
- uri
-
getPrefix
This method is not needed in this context, but can be implemented in a similar way.- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixes
in interfaceNamespaceContext
-