# wx.xml.XmlDoctype¶

Represents a DOCTYPE Declaration.

Example DOCTYPE: <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> .

In the above example, “plist” is the name of root element, “-//Apple//DTD PLIST 1.0//EN” (without the quotes) is the public identifier and “http://www.apple.com/DTDs/PropertyList-1.0.dtd” (again, without the quotes) is the system identifier.

A valid DOCTYPE exists in one of following forms:

• A root element name.

• A root element name and a system identifier.

• A root element name, a system identifier and a public identifier.

• A root element name and a public identifier. Although this form is not valid XML it is valid for SMGL.

The DOCTYPE may also contain an internal subset of declarations added between square brackets at the end. These have not been implemented at this time.

New in version 4.1/wxWidgets-3.1.0.

## Class Hierarchy¶

Inheritance diagram for class XmlDoctype:

## Methods Summary¶

 __init__ Creates and possible initializes the DOCTYPE. Clear Removes all the DOCTYPE values. GetFullString Returns the formatted DOCTYPE contents. GetPublicId Returns the public id of the document. GetRootName Returns the root name of the document. GetSystemId Returns the system id of the document. IsValid Returns True if the contents can produce a valid DOCTYPE string.

## Class API¶

class wx.xml.XmlDoctype(object)

Possible constructors:

XmlDoctype(rootName="", systemId="", publicId="")


Represents a DOCTYPE Declaration.

### Methods¶

__init__(self, rootName="", systemId="", publicId="")

Creates and possible initializes the DOCTYPE.

Parameters
• rootName (string) – The root name.

• systemId (string) – The system identifier.

• publicId (string) – The public identifier.

Clear(self)

Removes all the DOCTYPE values.

GetFullString(self)

Returns the formatted DOCTYPE contents.

This consists of all the text shown between the opening “<!DOCTYPE ” and closing “>” of a DOCTYPE declaration.

If this object is empty or invalid, i.e. IsValid returns False, this method returns an empty string.

Return type

string

GetPublicId(self)

Returns the public id of the document.

Return type

string

GetRootName(self)

Returns the root name of the document.

Return type

string

GetSystemId(self)

Returns the system id of the document.

Return type

string

IsValid(self)

Returns True if the contents can produce a valid DOCTYPE string.

For an object to be valid, it must have a non-empty root name and a valid system identifier (currently the validity checks of the latter are limited to checking that it doesn’t contain both single and float quotes).

Return type

bool

### Properties¶

FullString

PublicId

RootName

SystemId