|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xiruss.util.DomUtil
public class DomUtil
Field Summary | |
---|---|
(package private) static org.apache.log4j.Logger |
logger
|
Constructor Summary | |
---|---|
DomUtil()
|
Method Summary | |
---|---|
static java.util.Collection |
getDocumentNamespaces(org.w3c.dom.Element elem)
Given an element, returns the list of all unique namespace URIs used in the element tree rooted at that element. |
static org.w3c.dom.Document |
getDomForByteArray(byte[] byteArray)
Constructs a DOM from a byte array containing the bytes of an XML document. |
static org.w3c.dom.Document |
getDomForDocument(java.io.File xmlFile)
Constructs a DOM from the specified XML document file. |
static org.w3c.dom.Document |
getDomForStorageObject(StorageObject so)
|
static org.w3c.dom.Document |
getDomForStream(java.io.InputStream stream)
Constructs a DOM from the specified XML document file. |
static org.w3c.dom.Document |
getDomForString(java.lang.String docString)
Constructs a DOM from the specified XML document file. |
static void |
getElementNamespaces(org.w3c.dom.Element element,
java.util.Set namespaces)
Gets the namespaces declared on the element and adds them to the specified set. |
static java.lang.String |
getNamespacePrefix(org.w3c.dom.Element element,
java.lang.String nsURI)
Given an element node and a namespace URI, returns the local prefix associated with that namespace (that is, the nearest ancestor or self element that declares the namespace). |
static void |
getSubtreeNamespaces(org.w3c.dom.Element elem,
java.util.Set namespaces)
Recursive method to get all the namespaces within a subtree of elements. |
static java.lang.String |
UpdateSchemaLocationValue(java.lang.String originalAttVal,
java.lang.String schemaUri,
java.lang.String newSchemaLoc)
Given a schemaLocation attribute value, replaces the URI for a given namespace with the specified new URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
Constructor Detail |
---|
public DomUtil()
Method Detail |
---|
public static org.w3c.dom.Document getDomForDocument(java.io.File xmlFile) throws DomException
xmlFile
- Document entity of the file to load.
DomException
public static org.w3c.dom.Document getDomForStream(java.io.InputStream stream) throws DomException
xmlFile
- Document entity of the file to load.
DomException
public static org.w3c.dom.Document getDomForByteArray(byte[] byteArray) throws DomException
byteArray
- The bytes to process
DomException
public static org.w3c.dom.Document getDomForString(java.lang.String docString) throws DomException
xmlFile
- Document entity of the file to load.
DomException
public static org.w3c.dom.Document getDomForStorageObject(StorageObject so) throws DomException, java.io.IOException
candDoc
-
DomException
java.io.IOException
public static java.lang.String getNamespacePrefix(org.w3c.dom.Element element, java.lang.String nsURI)
element
- The element to check.nsURI
- The URI of the namespace whose prefix you want.
public static java.util.Collection getDocumentNamespaces(org.w3c.dom.Element elem)
public static void getSubtreeNamespaces(org.w3c.dom.Element elem, java.util.Set namespaces)
elem
- namespaces
- public static void getElementNamespaces(org.w3c.dom.Element element, java.util.Set namespaces)
element
- The element to examine.namespaces
- A set to which new namespace URIs will be added.public static java.lang.String UpdateSchemaLocationValue(java.lang.String originalAttVal, java.lang.String schemaUri, java.lang.String newSchemaLoc)
string
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |