3 class ConfigDoc_XMLSerializer_Types
extends ConfigDoc_XMLSerializer
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;