public final class JkUtilsXml
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Document |
createDocument()
Creates an empty document.
|
static org.w3c.dom.Element |
directChild(org.w3c.dom.Element parent,
java.lang.String childName)
Returns the direct getChild node of the specified element having specified
name.
|
static java.util.List<org.w3c.dom.Element> |
directChildren(org.w3c.dom.Element parent,
java.lang.String childName)
Returns specified element direct getChild node elements.
|
static java.lang.String |
directChildText(org.w3c.dom.Element parent,
java.lang.String childName)
Returns the text of the specified direct getChild of the specified element.
|
static org.w3c.dom.Document |
documentFrom(java.io.File documentFile)
Creates a document from the specified file.
|
static org.w3c.dom.Document |
documentFrom(java.nio.file.Path documentFile) |
static org.w3c.dom.Document |
documentFrom(java.lang.String xml)
Creates a document from the specified xml string.
|
static void |
output(org.w3c.dom.Document doc,
java.io.OutputStream outputStream)
Prints the specified document in the specified output getOutputStream.
|
public static org.w3c.dom.Document createDocument()
public static org.w3c.dom.Document documentFrom(java.io.File documentFile)
public static org.w3c.dom.Document documentFrom(java.nio.file.Path documentFile)
public static org.w3c.dom.Document documentFrom(java.lang.String xml)
public static org.w3c.dom.Element directChild(org.w3c.dom.Element parent, java.lang.String childName)
public static java.util.List<org.w3c.dom.Element> directChildren(org.w3c.dom.Element parent, java.lang.String childName)
public static java.lang.String directChildText(org.w3c.dom.Element parent, java.lang.String childName)
public static void output(org.w3c.dom.Document doc, java.io.OutputStream outputStream)