code: protected void parseTypeDefs(Document doc) {
      // Parse type definitions. Handy to match against defined AVP types
      // and to fill AVPs with generic function.
      // Format: <typedefn type-name="Integer32"  />
      //         <typedefn type-name="Enumerated" type-parent="Integer32" />
      NodeList typedefNodes = doc.getElementsByTagName("typedefn");
  
      for (int td = 0; td < typedefNodes.getLength(); td++) {
        Node typedefNode = typedefNodes.item(td);
        if (typedefNode.getNodeType() == Node.ELEMENT_NODE) {
          Element typedefElement = (Element) typedefNode;
  
          String typeName = typedefElement.getAttribute("type-name");
          String typeParent = typedefElement.getAttribute("type-parent");
  
          // UTF8String and Time are special situations, we don't want to convert these.
          if (typeParent == null || typeParent.equals("") || typeName.equals("UTF8String") || typeName.equals("Time")) {
            typeParent = typeName;
          }
  
          typedefMap.put(typeName, typeParent);
        }
      }
    }
docs: Parses the <typedefn /> attributes from a Dictionary XML Document
  
  @param doc the DOM object representing the XML Document with the Dictionary definitions