|
Milyn-Smooks Version 0.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.milyn.dom.DomUtils
W3C DOM utility methods.
Constructor Summary | |
DomUtils()
|
Method Summary | |
static void |
appendList(org.w3c.dom.Node node,
java.util.List nodes)
Append the nodes from the supplied list to the supplied node. |
static void |
copyChildNodes(org.w3c.dom.Node source,
org.w3c.dom.Node target)
Copy child node references from source to target. |
static java.util.List |
copyNodeList(org.w3c.dom.NodeList nodeList)
Copy the nodes of a NodeList into the supplied list. |
static java.lang.String |
getAttributeValue(org.w3c.dom.Element element,
java.lang.String attributeName)
Get attribute value, returning null if unset. |
static boolean |
getBooleanAttrib(org.w3c.dom.Element element,
java.lang.String attribName)
Get a boolean attribute from the supplied element. |
static org.w3c.dom.Element |
getParentElement(org.w3c.dom.Element child,
java.lang.String parentName)
Get the parent element of the supplied element having the specified tag name. |
static void |
insertBefore(org.w3c.dom.NodeList newNodes,
org.w3c.dom.Node refNode)
Insert the supplied nodes before the supplied reference node (refNode). |
static void |
removeChildren(org.w3c.dom.Node node)
Remove all child nodes from the supplied node. |
static org.w3c.dom.Element |
renameElement(org.w3c.dom.Element element,
java.lang.String replacementElement,
boolean keepChildContent,
boolean keepAttributes)
Rename element. |
static void |
replaceNode(org.w3c.dom.NodeList newNodes,
org.w3c.dom.Node oldNode)
Replace one node with a list of nodes. |
static void |
replaceNode(org.w3c.dom.NodeList newNodes,
org.w3c.dom.Node oldNode,
boolean clone)
Replace one node with a list of nodes. |
static void |
replaceNode(org.w3c.dom.Node newNode,
org.w3c.dom.Node oldNode)
Replace one node with another node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DomUtils()
Method Detail |
public static void copyChildNodes(org.w3c.dom.Node source, org.w3c.dom.Node target)
source
- Source Node.target
- Target Node.public static void replaceNode(org.w3c.dom.Node newNode, org.w3c.dom.Node oldNode)
newNode
- New node - added in same location as oldNode.oldNode
- Old node - removed.public static void insertBefore(org.w3c.dom.NodeList newNodes, org.w3c.dom.Node refNode)
newNodes
- Nodes to be inserted.refNode
- Reference node before which the supplied nodes should
be inserted.public static void replaceNode(org.w3c.dom.NodeList newNodes, org.w3c.dom.Node oldNode)
newNodes
- New nodes - added in same location as oldNode.oldNode
- Old node - removed.public static void replaceNode(org.w3c.dom.NodeList newNodes, org.w3c.dom.Node oldNode, boolean clone)
newNodes
- New nodes - added in same location as oldNode.oldNode
- Old node - removed.clone
- Clone Nodelist Nodes.public static org.w3c.dom.Element renameElement(org.w3c.dom.Element element, java.lang.String replacementElement, boolean keepChildContent, boolean keepAttributes)
element
- The element to be renamed.replacementElement
- The tag name of the replacement element.keepChildContent
- true
if the target element's child content
is to be copied to the replacement element, false if not. Default true
.keepAttributes
- true
if the target element's attributes
are to be copied to the replacement element, false if not. Default true
.
public static void removeChildren(org.w3c.dom.Node node)
node
- to be "cleared".public static java.util.List copyNodeList(org.w3c.dom.NodeList nodeList)
nodeList
- Nodelist to copy.
public static void appendList(org.w3c.dom.Node node, java.util.List nodes)
node
- Node to be appended to.nodes
- List of nodes to append.public static boolean getBooleanAttrib(org.w3c.dom.Element element, java.lang.String attribName)
element
- The element.attribName
- The attribute name.
public static org.w3c.dom.Element getParentElement(org.w3c.dom.Element child, java.lang.String parentName)
child
- Child element.parentName
- Parent element name.
public static java.lang.String getAttributeValue(org.w3c.dom.Element element, java.lang.String attributeName)
null
if unset.
Some DOM implementations return an empty string for an unset
attribute.
element
- The DOM element.attributeName
- The attribute to get.
null
if unset.
|
Milyn-Smooks Version 0.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |