- Timestamp:
- 2019-05-03T21:46:42+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r33043 r33045 1624 1624 } 1625 1625 1626 p ublic static void elementToLogAsString(Element e, boolean indent)1627 { 1628 String str = elementToString(e, indent);1626 private static void elementToLogAsString(String prefix, Element e, boolean indent, boolean debugEncoding) 1627 { 1628 String str = prefix + "\n" + elementToString(e, indent, debugEncoding); 1629 1629 System.err.println(str); 1630 logger.error(str); 1630 logger.info(str); 1631 } 1632 1633 // hex/unicode codepoint used only for those chars that are beyond printable/basic ASCII 1634 public static void elementToLogAsUnicodeDebugString(String prefix, Element e, boolean indent) 1635 { 1636 elementToLogAsString(prefix, e, indent, true); 1637 } 1638 1639 public static void elementToLogAsString(String prefix, Element e, boolean indent) 1640 { 1641 elementToLogAsString(prefix, e, indent, false); 1631 1642 } 1632 1643 1633 1644 // pass in debugEncoding=true to investigate encoding issues. This function will then return non-basic ASCII characters in hex 1634 p ublicstatic String elementToString(Element e, boolean indent, boolean debugEncoding)1645 private static String elementToString(Element e, boolean indent, boolean debugEncoding) 1635 1646 { 1636 1647 String str = ""; … … 1652 1663 1653 1664 // if debugging encoding issues, then encode unicode code pts as hex for all but non-alphanumeric and space/tab/newline chars 1654 if(debugEncoding) str = Misc. stringToHex(str);1665 if(debugEncoding) str = Misc.debugUnicodeString(str); 1655 1666 } 1656 1667 catch (Exception ex) … … 1667 1678 { 1668 1679 return elementToString(e, indent, false); 1680 } 1681 1682 // hex/unicode codepoint used only for those chars that are beyond printable/basic ASCII 1683 public static String elementToUnicodeDebugString(Element e, boolean indent) 1684 { 1685 return elementToString(e, indent, true); 1669 1686 } 1670 1687
Note:
See TracChangeset
for help on using the changeset viewer.