xml.dtd.DTD
¶
An xml.dtd.DTD
class represents the XML Document Type Definition.
- class xml.dtd.DTD¶
Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a
NotImplementedError
exception.
Class methods¶
- classmethod xml.dtd.DTD.create_from_buffer(type cls, buf, *, catalog=None, **kargs)¶
Returns a tuple with an
xml.dtd.DTD
and xml.ErrorLog object. Constructs a newxml.dtd.DTD
object after parsing the DTD content in the given buffer according to the XML 1.0 or XML 1.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
- classmethod xml.dtd.DTD.create_from_url(type cls, url, *, catalog=None, **kargs)¶
Returns a tuple with an
xml.dtd.DTD
and xml.ErrorLog object. Constructs a newxml.dtd.DTD
object after parsing the DTD content retrieved from the given url according to the XML 1.0 or XML 1.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
- classmethod xml.dtd.DTD.is_wellformed_buffer(type cls, buf, *, catalog=None, **kargs)¶
Checks the buffer buf containing a DTD document according to the XML 1.0 or XML 1.1 specification for wellformedness and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_wf_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
- classmethod xml.dtd.DTD.is_wellformed_url(type cls, url, *, catalog=None, **kargs)¶
Checks the DTD document at the given url according to the XML 1.0 or XML 1.1 specification for wellformedness and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_wf_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
- classmethod xml.dtd.DTD.validate_buffer(type cls, buf, *, catalog=None, **kargs)¶
Validates the buffer buf containing a DTD document according to the XML 1.0 or XML 1.1 specification and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
- classmethod xml.dtd.DTD.validate_url(type cls, url, *, catalog=None, **kargs)¶
Validates the DTD document at the given url according to the XML 1.0 or XML 1.1 specification and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_dtd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.
Attributes¶
- xml.dtd.DTD.attribute_list_declarations¶
Returns an iterator of
xml.dtd.AttlistDecl
objects which represent the attribute list declarations in the DTD.
- xml.dtd.DTD.doctype_name¶
Returns the name in the document type declaration specifying the root element type.
- xml.dtd.DTD.element_declarations¶
Returns an iterator of
xml.dtd.ElementDecl
objects which represent the element declarations in the DTD.
- xml.dtd.DTD.entity_declarations¶
Returns an iterator of
xml.dtd.EntityDecl
objects which represent the entity declarations in the DTD.
- xml.dtd.DTD.external_subset_uri¶
Returns the URI of the external DTD subset.
- xml.dtd.DTD.general_entity_declarations¶
Returns an iterator of
xml.dtd.GEDecl
objects which represent the general entity declarations in the DTD.
- xml.dtd.DTD.notation_declarations¶
Returns an iterator of
xml.dtd.NotationDecl
objects which represent the notation declarations in the DTD.
- xml.dtd.DTD.parameter_entity_declarations¶
Returns an iterator of
xml.dtd.PEDecl
objects which represent the parameter entity declarations in the DTD.
Methods¶
- xml.dtd.DTD.find_attribute_list_declaration(name)¶
Returns an
xml.dtd.AttlistDecl
object which represents the attribute list declaration with the given name, or None if no attribute list declaration was found.
- xml.dtd.DTD.find_element_declaration(name)¶
Returns an
xml.dtd.ElementDecl
object which represents the element declaration with the given name, or None if no element declaration was found.
- xml.dtd.DTD.find_entity_declarations(name)¶
Returns an
xml.dtd.EntityDecl
object which represents the entity declaration with the given name, or None if no entity declaration was found.
- xml.dtd.DTD.find_general_entity_declarations(name)¶
Returns an
xml.dtd.GEDecl
object which represents the general entity declaration with the given name, or None if no general entity declaration was found.
- xml.dtd.DTD.find_notation_declaration(name)¶
Returns an
xml.dtd.NotationDecl
object which represents the notation declaration with the given name, or None if no notation declaration was found.
- xml.dtd.DTD.find_parameter_entity_declarations(name)¶
Returns an
xml.dtd.PEDecl
object which represents the parameter entity declaration with the given name, or None if no parameter entity declaration was found.
- xml.dtd.DTD.sample_xml(name, SampleXMLGeneratorOptions options=None)¶
Generates a XML sample for this DTD. name specifies the name of the root element. A xml.SampleXMLGeneratorOptions instance can be used to configure the generator behavior. If no options are specified then a default xml.SampleXMLGeneratorOptions instance is used.
Special methods¶
__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__