Class XmlUtil

java.lang.Object
com.pnfsoftware.jeb.util.encoding.xml.XmlUtil

public class XmlUtil extends Object
XML utility methods.
  • Constructor Details

    • XmlUtil

      public XmlUtil()
  • Method Details

    • isSpace

      public static boolean isSpace(int codePoint)
      Determine whether the provided code point is a white space character.
      Parameters:
      codePoint -
      Returns:
    • skipSomeSpaces

      public static int skipSomeSpaces(String str, int idx)
      Skip 1+ WSP characters.
      Parameters:
      str -
      idx -
      Returns:
    • skipSpaces

      public static int skipSpaces(String str, int idx)
      Skip 0+ WSP characters.
      Parameters:
      str -
      idx -
      Returns:
    • skipWSP

      public static int skipWSP(String str, int idx, int minSpaceCount)
      Skip WSP characters.
      Parameters:
      str - string
      idx - start index
      minSpaceCount - the method will raise if fewer WSP chars were skipped
      Returns:
      new index, after skipping WSP chars
    • readToken

      public static int readToken(String str, int idx, Collection<Integer> stoppers, String[] atoken)
      Read a token.
      Parameters:
      str -
      idx - token start (cannot be a wsp); may be a single-quote or double-quote
      stoppers -
      atoken - output token
      Returns:
    • readToken

      public static int readToken(String str, int idx, Collection<Integer> stoppers, String[] atoken, boolean mustBeQuoted, boolean handleBackslashAxmlStyle)
      Read a token.
      Parameters:
      str -
      idx - token start (cannot be a wsp); may be a single-quote or double-quote
      stoppers -
      atoken - output token
      mustBeQuoted -
      handleBackslashAxmlStyle -
      Returns:
    • compare

      public static boolean compare(String str, int idx, String expected)
    • compareCI

      public static boolean compareCI(String str, int idx, String expected)
    • getFirstChildElement

      public static Element getFirstChildElement(Element e, String childName)
    • getChildrenElements

      public static List<Element> getChildrenElements(Element e, String childName)
    • format

      public static String format(Document doc)