Reorganize configdoc, but it's still broken.
[htmlpurifier/rdancer.git] / extras / ConfigDoc / XMLSerializer / Types.php
blob3082ead9771cfff5677303319ab317a6a3fbdfeb
1 <?php
3 class ConfigDoc_XMLSerializer_Types extends ConfigDoc_XMLSerializer
6 /**
7 * Serializes the types in a schema into DOM form
8 * @param $schema HTMLPurifier_ConfigSchema owner of types to serialize
9 * @return DOMDocument representing schema types
11 public function serialize($schema) {
12 $types_document = new DOMDocument('1.0', 'UTF-8');
13 $types_root = $types_document->createElement('types');
14 $types_document->appendChild($types_root);
15 $types_document->formatOutput = true;
16 foreach ($schema->types as $name => $expanded_name) {
17 $types_type = $types_document->createElement('type', $expanded_name);
18 $types_type->setAttribute('id', $name);
19 $types_root->appendChild($types_type);
21 return $types_document;