Class DomTools

java.lang.Object
org.episteme.social.linguistics.loaders.tigerxml.tools.DomTools

public class DomTools extends Object
Provides methods useful when utilizing the Document Object Model API as specified by the w3c. This class is for static use. * $Id: DomTools.java,v 1.2 2007-10-21 17:47:09 virtualcall Exp $
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • DomTools

      public DomTools()
  • Method Details

    • hasElement

      public static final boolean hasElement(Element ele, String name)
      Checks if the given Element has a child named name.
      Parameters:
      ele - The Element to be checked.
      name - The name of the child to be checked.
      Returns:
      true if ele has a child name, else false.
    • getElement

      public static final Element getElement(Element ele, String name)
      Returns the first element named name in Element ele.
      Parameters:
      ele - The Element holding the element to be retrieved.
      name - The name of the Element to be retrieved.
      Returns:
      The element to be retrieved.
    • printNodeInfo

      public static final void printNodeInfo(Node node)
      Prints information about a given node to stdout.
      Parameters:
      node - The node to print information about.
    • checkElementName

      public static final void checkElementName(Element ele, String name)
      Checks if the name of ele is name. If not, a warning message is printed to stderr.
      Parameters:
      ele - The Element to be checked.
      name - The name of the Element to be checked against.
    • getText

      public static final String getText(Element ele)
      Returns the text embeded in ele.
      Parameters:
      ele - The Element to be read out.
      Returns:
      The text embeded in ele.