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 | ) |
|
Definition at line 29 of file Xml.php.
References $interchange, and buildDirective().
33 $this->setIndent(
true);
34 $this->startDocument(
'1.0',
'UTF-8');
35 $this->startElement(
'configdoc');
42 if ($this->
namespace) $this->endElement();
buildDirective($directive)
◆ buildDirective()
HTMLPurifier_ConfigSchema_Builder_Xml::buildDirective |
( |
|
$directive | ) |
|
Definition at line 48 of file Xml.php.
References export(), and writeHTMLDiv().
Referenced by build().
53 if (!$this->
namespace || $this->
namespace !== $directive->id->getRootNamespace()) {
54 if ($this->
namespace) $this->endElement();
55 $this->
namespace = $directive->id->getRootNamespace();
56 $this->startElement(
'namespace');
57 $this->writeAttribute(
'id', $this->
namespace);
58 $this->writeElement(
'name', $this->
namespace);
61 $this->startElement(
'directive');
62 $this->writeAttribute(
'id', $directive->id->toString());
64 $this->writeElement(
'name', $directive->id->getDirective());
66 $this->startElement(
'aliases');
67 foreach ($directive->aliases as $alias) $this->writeElement(
'alias', $alias->toString());
70 $this->startElement(
'constraints');
71 if ($directive->version) $this->writeElement(
'version', $directive->version);
72 $this->startElement(
'type');
73 if ($directive->typeAllowsNull) $this->writeAttribute(
'allow-null',
'yes');
74 $this->text($directive->type);
76 if ($directive->allowed) {
77 $this->startElement(
'allowed');
78 foreach ($directive->allowed as $value => $x) $this->writeElement(
'value', $value);
81 $this->writeElement(
'default', $this->
export($directive->default));
82 $this->writeAttribute(
'xml:space',
'preserve');
83 if ($directive->external) {
84 $this->startElement(
'external');
85 foreach ($directive->external as $project) $this->writeElement(
'project', $project);
90 if ($directive->deprecatedVersion) {
91 $this->startElement(
'deprecated');
92 $this->writeElement(
'version', $directive->deprecatedVersion);
93 $this->writeElement(
'use', $directive->deprecatedUse->toString());
97 $this->startElement(
'description');
◆ export()
HTMLPurifier_ConfigSchema_Builder_Xml::export |
( |
|
$var | ) |
|
|
protected |
Definition at line 24 of file Xml.php.
Referenced by buildDirective().
25 if ($var === array())
return 'array()';
26 return var_export($var,
true);
◆ writeHTMLDiv()
HTMLPurifier_ConfigSchema_Builder_Xml::writeHTMLDiv |
( |
|
$html | ) |
|
|
protected |
Definition at line 13 of file Xml.php.
References HTMLPurifier\getInstance().
Referenced by buildDirective().
14 $this->startElement(
'div');
17 $html = $purifier->purify($html);
18 $this->writeAttribute(
'xmlns',
'http://www.w3.org/1999/xhtml');
19 $this->writeRaw($html);
static getInstance($prototype=null)
◆ $interchange
HTMLPurifier_ConfigSchema_Builder_Xml::$interchange |
|
protected |
◆ $namespace
HTMLPurifier_ConfigSchema_Builder_Xml::$namespace |
|
private |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php