Constructor and Description |
---|
XMLWriter() |
Modifier and Type | Method and Description |
---|---|
static Node |
createDocument(java.lang.String version, java.lang.String encoding)
Create XML document root node according to XML version and XML document encoding.
|
static void |
writeAttributes(Node node, java.lang.String[] attributeNames, java.lang.String[] attributeValues)
Add properties to the node.
|
static Node |
writeChildNode(Node node, java.lang.String nodeName)
Add child nodes which have the specific name to the specific node.
|
static Node |
writeChildNode(Node node, java.lang.String nodeName, java.lang.String nodeValue)
Add a child node with the specified name and the specified value to the node.
|
static Node |
writeChildNode(Node node, java.lang.String nodeName, java.lang.String[] attributeNames, java.lang.String[] attributeValues)
Add child nodes which have the specific name, properties and property values to the specific node.
|
static void |
writeChildNodes(Node node, java.lang.String nodeName, java.lang.String[] nodeValues)
Add several child nodes which have the same name and different values to the specific node.
|
public static Node writeChildNode(Node node, java.lang.String nodeName, java.lang.String nodeValue)
node
- the parent node to add child node.nodeName
- the name of the child node.nodeValue
- the value of the child node.public static void writeAttributes(Node node, java.lang.String[] attributeNames, java.lang.String[] attributeValues)
node
- the node to add properties.attributeNames
- attribute name array, which correspond to the attributeValues parameter.attributeValues
- attribute value array, which correspond to the attributeNames parameter.public static void writeChildNodes(Node node, java.lang.String nodeName, java.lang.String[] nodeValues)
node
- the parent node to add child node.nodeName
- the name of the added child node.nodeValues
- the string array of the values of the added child nodes.public static Node writeChildNode(Node node, java.lang.String nodeName, java.lang.String[] attributeNames, java.lang.String[] attributeValues)
node
- the parent node to add child node.nodeName
- the name of the added child node.attributeNames
- attribute name array of the child node, which correspond to the attributeValues parameter.attributeValues
- attribute value array of the child node, which correspond to the attributeNames parameter.public static Node writeChildNode(Node node, java.lang.String nodeName)
node
- the parent node to add child node.nodeName
- the name of the added child node.public static Node createDocument(java.lang.String version, java.lang.String encoding)
Create XML document root node according to XML version and XML document encoding.
XML document node is like “<?xml version="version" encoding="encoding"?>”.
version
- XML version.encoding
- XML document encoding.