Class ContentHashBuilder

java.lang.Object
org.iirds.dita.ot.plugin.module.ContentHashBuilder

public class ContentHashBuilder extends Object
Generate a hash value of XML content
Author:
Martin Kreutzer, Empolis Information Management GmbH
  • Field Details

    • excludeAttributes

      protected Set<String> excludeAttributes
  • Constructor Details

    • ContentHashBuilder

      public ContentHashBuilder()
  • Method Details

    • getHash

      public String getHash(Element element)
      Generates a hash of the content of an element. Some technical attribute (xtrc, xtrf, xnlns:dita-ot), XML comments, and XML processing instructions are not taken into account. Implementation uses SHA-256.
      Parameters:
      element - the element for which to generate a hash
      Returns:
      the hash (hex-encoded)
    • update

      protected void update(MessageDigest md, String text)
    • getSortedAttributes

      List<Attr> getSortedAttributes(Element element)
    • update

      protected void update(MessageDigest md, Node root)