## DTD Handling

DTD Handling —

## Synopsis

    void        (*CongDtdElementCallback)       (xmlElementPtr dtd_element,
                                                 gpointer user_data);
    void        cong_dtd_for_each_element       (xmlDtdPtr dtd,
                                                 CongDtdElementCallback callback,
                                                 gpointer user_data);
    void        (*CongDtdAttributeCallback)     (xmlElementPtr dtd_element,
                                                 xmlAttributePtr attr,
                                                 gpointer user_data);
    void        cong_dtd_for_each_attribute     (xmlElementPtr dtd_element,
                                                 CongDtdAttributeCallback callback,
                                                 gpointer user_data);
    gboolean    cong_dtd_element_content_can_contain_pcdata
                                                (xmlElementContentPtr content);
    xmlElementPtr cong_dtd_element_get_element_for_node
                                                (xmlDtdPtr dtd,
                                                 xmlNodePtr xml_node);
    gboolean    cong_dtd_content_model_node_is_element
                                                (xmlElementContentPtr content,
                                                 xmlElementPtr dtd_element);
    xmlElementPtr cong_dtd_get_element_for_content
                                                (xmlDtdPtr dtd,
                                                 xmlElementContentPtr content);
    void        cong_dtd_for_each_reference_to_element
                                                (xmlDtdPtr dtd,
                                                 xmlElementPtr dtd_element,
                                                 CongDtdElementReferenceCallback callback,
                                                 gpointer user_data);
    guint       cong_dtd_count_references_to_element
                                                (xmlDtdPtr dtd,
                                                 xmlElementPtr dtd_element);
    GList*      cong_dtd_guess_start_elements   (xmlDtdPtr dtd);

## Description

## Details

### CongDtdElementCallback ()

    void        (*CongDtdElementCallback)       (xmlElementPtr dtd_element,
                                                 gpointer user_data);

`dtd_element` : |
`user_data` : |

### cong_dtd_for_each_element ()

    void        cong_dtd_for_each_element       (xmlDtdPtr dtd,
                                                 CongDtdElementCallback callback,
                                                 gpointer user_data);

TODO: Write me

`dtd` : |
`callback` : |
`user_data` : |

### CongDtdAttributeCallback ()

    void        (*CongDtdAttributeCallback)     (xmlElementPtr dtd_element,
                                                 xmlAttributePtr attr,
                                                 gpointer user_data);

`dtd_element` : |
`attr` : |
`user_data` : |

### cong_dtd_for_each_attribute ()

    void        cong_dtd_for_each_attribute     (xmlElementPtr dtd_element,
                                                 CongDtdAttributeCallback callback,
                                                 gpointer user_data);

TODO: Write me

`dtd_element` : |
`callback` : |
`user_data` : |

### cong_dtd_element_content_can_contain_pcdata ()

    gboolean    cong_dtd_element_content_can_contain_pcdata
                                                (xmlElementContentPtr content);

TODO: Write me

`content` : |
Returns : |

### cong_dtd_element_get_element_for_node ()

    xmlElementPtr cong_dtd_element_get_element_for_node
                                                (xmlDtdPtr dtd,
                                                 xmlNodePtr xml_node);

`dtd` : |
`xml_node` : |
Returns : |

### cong_dtd_content_model_node_is_element ()

    gboolean    cong_dtd_content_model_node_is_element
                                                (xmlElementContentPtr content,
                                                 xmlElementPtr dtd_element);

Determine if this node in the content model is a direct cross-reference to the given element. Useful for determining recursion, nesting of elements, etc

`content` : | a node in the content model tree for one of the elements in a DTD
`dtd_element` : | one of the elements in a DTD (usually a different one)
Returns : | TRUE if it is the element, FALSE if it's another element, PCDATA, etc

### cong_dtd_get_element_for_content ()

    xmlElementPtr cong_dtd_get_element_for_content
                                                (xmlDtdPtr dtd,
                                                 xmlElementContentPtr content);

Get the element in the DTD corresponding to a node in the content model (if any)

`dtd` : |
`content` : |
Returns : |

### cong_dtd_for_each_reference_to_element ()

    void        cong_dtd_for_each_reference_to_element
                                                (xmlDtdPtr dtd,
                                                 xmlElementPtr dtd_element,
                                                 CongDtdElementReferenceCallback callback,
                                                 gpointer user_data);

Function to search through the content models in the DTD, calling the callback for any reference to the given element.

Handles the case where the element is part of a recursive content model (which would allow arbitrary numbers of that element to be added) by treating each as a single cross-reference.

`dtd` : |
`dtd_element` : |
`callback` : |
`user_data` : |

### cong_dtd_count_references_to_element ()

    guint       cong_dtd_count_references_to_element
                                                (xmlDtdPtr dtd,
                                                 xmlElementPtr dtd_element);

`dtd` : |
`dtd_element` : |
Returns : |

### cong_dtd_guess_start_elements ()

    GList*      cong_dtd_guess_start_elements   (xmlDtdPtr dtd);

`dtd` : |
Returns : |