|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.pax.XmlUtil
public class XmlUtil
This class provides general helper classes that normally should be part of the Java API.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_NS_PREFIX
The prefix name that is used for the default namespace (i.e. |
| Method Summary | |
|---|---|
void |
addNamespacesFrom(NamespacePrefixMapper namespaces,
org.w3c.dom.Element element)
Adds all namespaces that are declared in the given element with their prefix to the provided namespace prefix mapper. |
void |
addNamespacesFromElementAndChildren(NamespacePrefixMapper namespaces,
org.w3c.dom.Element element)
Adds all namespaces that are declared in the given element and all child elements together with their prefixes to the provides namespace prefix mapper. |
static XmlUtil |
current()
Returns the only instance this class supports (design pattern "Singleton") |
javax.xml.namespace.NamespaceContext |
extractNamespacesFrom(org.w3c.dom.Document document)
Extracts all namespace definitions from the given document and returns them in a NamespaceContext implementation. |
javax.xml.namespace.NamespaceContext |
extractNamespacesFrom(org.w3c.dom.Element rootElement)
Extracts all namespace definitions from the given root element and returns them in a NamespaceContext implementation. |
org.w3c.dom.Document |
readXmlFile(java.lang.String filename)
Returns the document object read from the specified XML file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_NS_PREFIX
| Method Detail |
|---|
public static XmlUtil current()
public org.w3c.dom.Document readXmlFile(java.lang.String filename)
throws java.lang.Exception
java.lang.Exception
public void addNamespacesFrom(NamespacePrefixMapper namespaces,
org.w3c.dom.Element element)
namespaces - An implementation of a NamespaceContext that can collect prefix to namespace mappings (must not be null)element - The element from which to extract namespace declarations.
public void addNamespacesFromElementAndChildren(NamespacePrefixMapper namespaces,
org.w3c.dom.Element element)
namespaces - An implementation of a NamespaceContext that can collect prefix to namespace mappings (must not be null)element - The element from which to start recursivly extracting namespace declarations.public javax.xml.namespace.NamespaceContext extractNamespacesFrom(org.w3c.dom.Element rootElement)
public javax.xml.namespace.NamespaceContext extractNamespacesFrom(org.w3c.dom.Document document)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||