Converts HTMLPurifier_ConfigSchema_Interchange to an XML format, which can be further processed to generate documentation.
More...
Converts HTMLPurifier_ConfigSchema_Interchange to an XML format, which can be further processed to generate documentation.
Definition at line 7 of file Xml.php.
◆ build()
HTMLPurifier_ConfigSchema_Builder_Xml::build |
( |
|
$interchange | ) |
|
- Parameters
-
Definition at line 50 of file Xml.php.
References $interchange, and buildDirective().
55 $this->setIndent(
true);
56 $this->startDocument(
'1.0',
'UTF-8');
57 $this->startElement(
'configdoc');
64 if ($this->
namespace) {
$interchange
HTMLPurifier_ConfigSchema_Interchange
buildDirective($directive)
◆ buildDirective()
HTMLPurifier_ConfigSchema_Builder_Xml::buildDirective |
( |
|
$directive | ) |
|
- Parameters
-
Definition at line 75 of file Xml.php.
References $x, export(), and writeHTMLDiv().
Referenced by build().
80 if (!$this->
namespace || $this->
namespace !== $directive->id->getRootNamespace()) {
81 if ($this->
namespace) {
84 $this->
namespace = $directive->id->getRootNamespace();
85 $this->startElement(
'namespace');
86 $this->writeAttribute(
'id', $this->
namespace);
87 $this->writeElement(
'name', $this->
namespace);
90 $this->startElement(
'directive');
91 $this->writeAttribute(
'id', $directive->id->toString());
93 $this->writeElement(
'name', $directive->id->getDirective());
95 $this->startElement(
'aliases');
96 foreach ($directive->aliases as $alias) {
97 $this->writeElement(
'alias', $alias->toString());
101 $this->startElement(
'constraints');
102 if ($directive->version) {
103 $this->writeElement(
'version', $directive->version);
105 $this->startElement(
'type');
106 if ($directive->typeAllowsNull) {
107 $this->writeAttribute(
'allow-null',
'yes');
109 $this->text($directive->type);
111 if ($directive->allowed) {
112 $this->startElement(
'allowed');
113 foreach ($directive->allowed as $value =>
$x) {
114 $this->writeElement(
'value', $value);
118 $this->writeElement(
'default', $this->
export($directive->default));
119 $this->writeAttribute(
'xml:space',
'preserve');
120 if ($directive->external) {
121 $this->startElement(
'external');
122 foreach ($directive->external as $project) {
123 $this->writeElement(
'project', $project);
129 if ($directive->deprecatedVersion) {
130 $this->startElement(
'deprecated');
131 $this->writeElement(
'version', $directive->deprecatedVersion);
132 $this->writeElement(
'use', $directive->deprecatedUse->toString());
136 $this->startElement(
'description');
◆ export()
HTMLPurifier_ConfigSchema_Builder_Xml::export |
( |
|
$var | ) |
|
|
protected |
- Parameters
-
- Returns
- string
Definition at line 39 of file Xml.php.
Referenced by buildDirective().
41 if ($var === array()) {
44 return var_export($var,
true);
◆ writeHTMLDiv()
HTMLPurifier_ConfigSchema_Builder_Xml::writeHTMLDiv |
( |
|
$html | ) |
|
|
protected |
- Parameters
-
Definition at line 23 of file Xml.php.
References $html, and HTMLPurifier\getInstance().
Referenced by buildDirective().
25 $this->startElement(
'div');
29 $this->writeAttribute(
'xmlns',
'http://www.w3.org/1999/xhtml');
30 $this->writeRaw(
$html);
static getInstance($prototype=null)
Singleton for enforcing just one HTML Purifier in your system.
◆ $interchange
HTMLPurifier_ConfigSchema_Builder_Xml::$interchange |
|
protected |
◆ $namespace
HTMLPurifier_ConfigSchema_Builder_Xml::$namespace |
|
private |
string
Definition at line 18 of file Xml.php.
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php