Release 2.0.1, merged in 1181 to HEAD.
[htmlpurifier.git] / configdoc / library / ConfigDoc / XMLSerializer / Types.php
blob414778e249097f696a98a9f38fff33b7c6850d4a
1 <?php
3 require_once 'ConfigDoc/XMLSerializer.php';
5 class ConfigDoc_XMLSerializer_Types extends ConfigDoc_XMLSerializer
8 /**
9 * Serializes the types in a schema into DOM form
10 * @param $schema HTMLPurifier_ConfigSchema owner of types to serialize
12 public function serialize($schema) {
13 $types_document = new DOMDocument('1.0', 'UTF-8');
14 $types_root = $types_document->createElement('types');
15 $types_document->appendChild($types_root);
16 $types_document->formatOutput = true;
17 foreach ($schema->types as $name => $expanded_name) {
18 $types_type = $types_document->createElement('type', $expanded_name);
19 $types_type->setAttribute('id', $name);
20 $types_root->appendChild($types_type);
22 return $types_document;