public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
addChild(Node parent,
String name)
Add a new child node to a parent node
|
static Document |
convertToDocument(net.sf.saxon.s9api.XdmNode node)
Convert an XdmNode to a Document node
|
static net.sf.saxon.s9api.XdmNode |
convertToXdmNode(Document document,
net.sf.saxon.s9api.DocumentBuilder documentBuilder,
boolean useFile)
Convert a Document node to an XdmNode
|
static Node |
getChild(Node node,
String name)
Get the first child with a given name
|
static String |
getValue(net.sf.saxon.s9api.XdmNode node,
net.sf.saxon.s9api.QName childName)
Get the string value of a child node
|
static boolean |
isBraille(char c)
Determine whether a unicode character is in the braille range
|
public static Document convertToDocument(net.sf.saxon.s9api.XdmNode node) throws ParserConfigurationException, SAXException, IOException
node - XdmNodeParserConfigurationException - thrown on parse exceptionsSAXException - thrown on a SAX exceptionIOException - thrown on an IO exceptionpublic static net.sf.saxon.s9api.XdmNode convertToXdmNode(Document document, net.sf.saxon.s9api.DocumentBuilder documentBuilder, boolean useFile) throws IOException, net.sf.saxon.s9api.SaxonApiException
document - Document nodedocumentBuilder - document builderuseFile - if true, the resulting XdmNode will be saved in a temporary file so that it has an URIIOException - thrown on an IO exceptionnet.sf.saxon.s9api.SaxonApiException - thrown on a Saxon API exceptionpublic static Node getChild(Node node, String name)
node - nodename - child node namepublic static Element addChild(Node parent, String name)
parent - parent nodename - name of the child nodepublic static String getValue(net.sf.saxon.s9api.XdmNode node, net.sf.saxon.s9api.QName childName)
node - XdmNodechildName - child namepublic static boolean isBraille(char c)
c - unicode characterCopyright © 2010–2017 The DAISY Consortium. All rights reserved.