| Version: 3.3.1

Public Member Functions | List of all members
wxXmlDoctype Class Reference
Class List by Category » XML

`#include <wx/xml/xml.h>`

## Detailed Description

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:

1. A root element name.
2. A root element name and a system identifier.
3. A root element name, a system identifier and a public identifier.
4. 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.

Since
  3.1.0

##

Library: wxXML
Category: XML

See also
  wxXmlDocument

## Public Member Functions
| wxXmlDoctype (const wxString &rootName=wxString(), const wxString &systemId=wxString(), const wxString &publicId=wxString())
| Creates and possible initializes the DOCTYPE. More...
void | Clear ()
| Removes all the DOCTYPE values. More...
const wxString & | GetRootName () const
| Returns the root name of the document. More...
const wxString & | GetSystemId () const
| Returns the system id of the document. More...
const wxString & | GetPublicId () const
| Returns the public id of the document. More...
wxString | GetFullString () const
| Returns the formatted DOCTYPE contents. More...
bool | IsValid () const
| Returns true if the contents can produce a valid DOCTYPE string. More...

## Constructor & Destructor Documentation

## ◆ wxXmlDoctype()

wxXmlDoctype::wxXmlDoctype | ( | const wxString & | rootName = `wxString()`,
|  | const wxString & | systemId = `wxString()`,
|  | const wxString & | publicId = `wxString()`
| ) |  |

Creates and possible initializes the DOCTYPE.

Parameters

  rootName | The root name.
  systemId | The system identifier.
  publicId | The public identifier.

## Member Function Documentation

## ◆ Clear()

void wxXmlDoctype::Clear | ( |  | ) |

Removes all the DOCTYPE values.

## ◆ GetFullString()

wxString wxXmlDoctype::GetFullString | ( |  | ) | const

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.

## ◆ GetPublicId()

const wxString& wxXmlDoctype::GetPublicId | ( |  | ) | const

Returns the public id of the document.

## ◆ GetRootName()

const wxString& wxXmlDoctype::GetRootName | ( |  | ) | const

Returns the root name of the document.

## ◆ GetSystemId()

const wxString& wxXmlDoctype::GetSystemId | ( |  | ) | const

Returns the system id of the document.

## ◆ IsValid()

bool wxXmlDoctype::IsValid | ( |  | ) | const

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 double quotes).