|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.util.DOMUtils
public class DOMUtils
Some utility methods for common tasks when building DOM trees in memory.
In this documentation <a>
means an Element
instance with name a
.
Constructor Summary | |
---|---|
DOMUtils()
|
Method Summary | |
---|---|
static void |
appendCDATA(org.w3c.dom.Element parent,
java.lang.String content)
Adds a nested CDATA section. |
static void |
appendCDATAElement(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String content)
Adds a nested CDATA section in a new child element. |
static void |
appendText(org.w3c.dom.Element parent,
java.lang.String content)
Adds nested text. |
static void |
appendTextElement(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String content)
Adds nested text in a new child element. |
static org.w3c.dom.Element |
createChildElement(org.w3c.dom.Element parent,
java.lang.String name)
Creates a named Element and appends it to the given element, returns it. |
static org.w3c.dom.Document |
newDocument()
Get a new Document instance, |
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 org.w3c.dom.Document newDocument()
public static org.w3c.dom.Element createChildElement(org.w3c.dom.Element parent, java.lang.String name)
This means
createChildElement(<a>, "b")creates
<a> <b/> </a>and returns
<b>
.
parent
- element that will receive the new element as child.name
- name of the new element.
public static void appendText(org.w3c.dom.Element parent, java.lang.String content)
This means
appendText(<a>, "b")creates
<a>b</a>
parent
- element that will receive the new element as child.content
- text content.public static void appendCDATA(org.w3c.dom.Element parent, java.lang.String content)
This means
appendCDATA(<a>, "b")creates
<a><[!CDATA[b]]></a>
parent
- element that will receive the new element as child.content
- text content.public static void appendTextElement(org.w3c.dom.Element parent, java.lang.String name, java.lang.String content)
This means
appendTextElement(<a>, "b", "c")creates
<a> <b>c</b> </a>
parent
- element that will receive the new element as child.name
- of the child element.content
- text content.public static void appendCDATAElement(org.w3c.dom.Element parent, java.lang.String name, java.lang.String content)
This means
appendCDATAElement(<a>, "b", "c")creates
<a> <b><![CDATA[c]]></b> </a>
parent
- element that will receive the new element as child.name
- of the child element.content
- text content.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |