public class XMLUtil extends Object
Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
buildXPath(Node from,
Element to)
FOR DIAGNOSTIC PURPOSES ONLY - incomplete
Builds a path to the node relative to the to node provided. |
static NodeList |
combine(NodeList... nls)
Provides a NodeList of multiple nodelists
|
static DocumentBuilder |
getDocumentBuilder()
provides a document builder that is namespace aware but not validating by default
|
static DocumentBuilder |
getDocumentBuilder(boolean namespaceAware,
boolean validating) |
static Document |
newDocument()
utility function for creating a document
|
static Document |
parse(File source)
utility function for parsing xml
|
static Document |
parse(InputStream source)
utility function for parsing xml
|
static Document |
parse(org.alfresco.service.cmr.repository.NodeRef nodeRef,
ContentService contentService)
utility function for parsing xml
|
static Document |
parse(Reader source)
utility function for parsing xml
|
static Document |
parse(String source)
utility function for parsing xml
|
static void |
print(Node n,
File output)
utility function for serializing a node
|
static void |
print(Node n,
Writer output)
utility function for serializing a node
|
static void |
print(Node n,
Writer output,
boolean indent)
utility function for serializing a node
|
static String |
toString(Node n)
utility function for serializing a node
|
static String |
toString(Node n,
boolean indent)
utility function for serializing a node
|
public static Document newDocument()
public static void print(Node n, Writer output, boolean indent)
public static void print(Node n, File output) throws IOException
IOException
public static String toString(Node n, boolean indent)
public static Document parse(String source) throws SAXException, IOException
SAXException
IOException
public static Document parse(org.alfresco.service.cmr.repository.NodeRef nodeRef, ContentService contentService) throws SAXException, IOException
SAXException
IOException
public static Document parse(File source) throws SAXException, IOException
SAXException
IOException
public static Document parse(InputStream source) throws SAXException, IOException
SAXException
IOException
public static Document parse(Reader source) throws SAXException, IOException
SAXException
IOException
public static DocumentBuilder getDocumentBuilder()
public static String buildXPath(Node from, Element to)
from
- the node from which to build the xpathto
- an ancestor of from which will be the root of the pathpublic static DocumentBuilder getDocumentBuilder(boolean namespaceAware, boolean validating)
Copyright © 2005–2017 Alfresco Software. All rights reserved.