ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_ConfigSchema_Builder_Xml Class Reference

Converts HTMLPurifier_ConfigSchema_Interchange to an XML format, which can be further processed to generate documentation. More...

+ Inheritance diagram for HTMLPurifier_ConfigSchema_Builder_Xml:
+ Collaboration diagram for HTMLPurifier_ConfigSchema_Builder_Xml:

Public Member Functions

 build ($interchange)
 buildDirective ($directive)

Protected Member Functions

 writeHTMLDiv ($html)
 export ($var)

Protected Attributes

 $interchange

Private Attributes

 $namespace

Detailed Description

Converts HTMLPurifier_ConfigSchema_Interchange to an XML format, which can be further processed to generate documentation.

Definition at line 7 of file Xml.php.

Member Function Documentation

HTMLPurifier_ConfigSchema_Builder_Xml::build (   $interchange)

Definition at line 29 of file Xml.php.

References $interchange, and buildDirective().

{
// global access, only use as last resort
$this->interchange = $interchange;
$this->setIndent(true);
$this->startDocument('1.0', 'UTF-8');
$this->startElement('configdoc');
$this->writeElement('title', $interchange->name);
foreach ($interchange->directives as $directive) {
$this->buildDirective($directive);
}
if ($this->namespace) $this->endElement(); // namespace
$this->endElement(); // configdoc
$this->flush();
}

+ Here is the call graph for this function:

HTMLPurifier_ConfigSchema_Builder_Xml::buildDirective (   $directive)

Definition at line 48 of file Xml.php.

References export(), and writeHTMLDiv().

Referenced by build().

{
// Kludge, although I suppose having a notion of a "root namespace"
// certainly makes things look nicer when documentation is built.
// Depends on things being sorted.
if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) {
if ($this->namespace) $this->endElement(); // namespace
$this->namespace = $directive->id->getRootNamespace();
$this->startElement('namespace');
$this->writeAttribute('id', $this->namespace);
$this->writeElement('name', $this->namespace);
}
$this->startElement('directive');
$this->writeAttribute('id', $directive->id->toString());
$this->writeElement('name', $directive->id->getDirective());
$this->startElement('aliases');
foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString());
$this->endElement(); // aliases
$this->startElement('constraints');
if ($directive->version) $this->writeElement('version', $directive->version);
$this->startElement('type');
if ($directive->typeAllowsNull) $this->writeAttribute('allow-null', 'yes');
$this->text($directive->type);
$this->endElement(); // type
if ($directive->allowed) {
$this->startElement('allowed');
foreach ($directive->allowed as $value => $x) $this->writeElement('value', $value);
$this->endElement(); // allowed
}
$this->writeElement('default', $this->export($directive->default));
$this->writeAttribute('xml:space', 'preserve');
if ($directive->external) {
$this->startElement('external');
foreach ($directive->external as $project) $this->writeElement('project', $project);
$this->endElement();
}
$this->endElement(); // constraints
if ($directive->deprecatedVersion) {
$this->startElement('deprecated');
$this->writeElement('version', $directive->deprecatedVersion);
$this->writeElement('use', $directive->deprecatedUse->toString());
$this->endElement(); // deprecated
}
$this->startElement('description');
$this->writeHTMLDiv($directive->description);
$this->endElement(); // description
$this->endElement(); // directive
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HTMLPurifier_ConfigSchema_Builder_Xml::export (   $var)
protected

Definition at line 24 of file Xml.php.

Referenced by buildDirective().

{
if ($var === array()) return 'array()';
return var_export($var, true);
}

+ Here is the caller graph for this function:

HTMLPurifier_ConfigSchema_Builder_Xml::writeHTMLDiv (   $html)
protected

Definition at line 13 of file Xml.php.

References HTMLPurifier\getInstance().

Referenced by buildDirective().

{
$this->startElement('div');
$html = $purifier->purify($html);
$this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
$this->writeRaw($html);
$this->endElement(); // div
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

HTMLPurifier_ConfigSchema_Builder_Xml::$interchange
protected

Definition at line 10 of file Xml.php.

Referenced by build().

HTMLPurifier_ConfigSchema_Builder_Xml::$namespace
private

Definition at line 11 of file Xml.php.


The documentation for this class was generated from the following file: