public class MaryDomUtils extends DomUtils
factory, logger, validatingFactory
Constructor and Description |
---|
MaryDomUtils() |
Modifier and Type | Method and Description |
---|---|
static Element |
appendToken(Element t,
String newTokenText)
Create a new <t> element and insert it after t.
|
static Element |
createBoundary(Document doc)
Create a default boundary element belonging to document doc, but not yet attached.
|
static Element |
encloseWithMTU(Element t,
String orig,
String accentPosition)
Create a new <mtu> element, inserted in the tree at the position of t and enclosing t.
|
static Locale |
getLocale(Document doc)
Try to determine the locale of a document by looking at the xml:lang attribute of the document element.
|
static boolean |
isSchemaValid(Document doc)
Verify whether a given document is valid in the sense of Schema XML validation.
|
static void |
setTokenText(Element t,
String s)
Convenience method for setting the text string of a token element.
|
static String |
tokenText(Element t)
Convenience method returning the text string of a token element.
|
closestCommonAncestor, compareNodes, createNodeIterator, createNodeIterator, createTreeWalker, createTreeWalker, document2File, document2Stream, document2String, encloseNodesWithNewElement, getAncestor, getAncestor, getAttributeFromClosestAncestorOfAnyKind, getClosestAncestorWithAttribute, getFirstChildElement, getFirstElementByTagName, getHighestLevelAncestor, getLastChildElement, getLastElementByTagName, getNextOfItsKindIn, getNextSiblingElement, getNextSiblingElementByTagName, getNodeListAsList, getPlainTextBelow, getPreviousOfItsKindIn, getPreviousSiblingElement, getPreviousSiblingElementByTagName, hasAncestor, insertAfter, isAncestor, isFirstOfItsKindIn, isFirstOfItsKindIn, isLastOfItsKindIn, isLastOfItsKindIn, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, replaceElement, serializeToString, trimAllTextNodes, trimEmptyTextNodes
public static Element encloseWithMTU(Element t, String orig, String accentPosition)
t
- the <t> element to encloseorig
- the original text for the MTU, saved in the orig attributeaccentPosition
- optionally, specify an accent position, saved in the accent attribute of the mtu element. If null, no accent
attribute is inserted.public static Element appendToken(Element t, String newTokenText)
t
- tnewTokenText
- newTokenTextpublic static String tokenText(Element t)
t
- tpublic static void setTokenText(Element t, String s)
t
- ts
- spublic static Element createBoundary(Document doc)
doc
- the maryxml document in which to create the boundary.public static Locale getLocale(Document doc)
doc
- the document in which to look for a locale.public static boolean isSchemaValid(Document doc) throws MaryConfigurationException
doc
- The document to verify.MaryConfigurationException
- if the validation cannot be carried outCopyright © 2000–2016 DFKI GmbH. All rights reserved.