DtdReader — Reads a DTD file.

This module defines the DtdReader class.

class admit.xmlio.DtdReader.DtdReader(fileName)[source]

Class for reading in a dtd file and accumulating all of the different bits.

Parameters:

fileName : str

The name of the dtd file to read (e.g. Moment_BDP.dtd).

Attributes

fileName (str) The name of the dtd file to read (e.g. Moment_BDP.dtd).
order (List) Listing of the order that nodes in the xml should appear.
types (Dict) Dictionary for the type of data for each node (e.g. bt.INT).
dtd (List) Listing of the dtd contents to be written at the top of an xml file.
keys (List) List of the keys found for the top level nodes.

Methods

getDtd() Returns the contents of the dtd attribute
getKeys() Returns the contents of the keys attribute
getOrder() Returns the order attribute
getTypes() Returns the contents of the types attribute
parse() Method to parse the given dtd file
getDtd()[source]

Returns the contents of the dtd attribute

Parameters:None
Returns:List of the lines of the dtd
getKeys()[source]

Returns the contents of the keys attribute

Parameters:None
Returns:List containing the keys in the main node
getOrder()[source]

Returns the order attribute

Parameters:None
Returns:List containing the order nodes should appear
getTypes()[source]

Returns the contents of the types attribute

Parameters:None
Returns:Dictionary with the node names and data types
parse()[source]

Method to parse the given dtd file

Parameters:None
Returns:None