private void ShowHierarchy(XmlSchemaSet schemaSet, TextWriter writer) { var schema = schemaSet.Schemas(Constants.InvoiceTargetNamespace).Cast<XmlSchema>().Single(); prefixLookup = schema.Namespaces.ToArray().Where(v => !string.IsNullOrEmpty(v.Name)).ToDictionary(k => k.Namespace, v => v.Name); PrintSchemaDetail(schema, writer); var prefixes = schemaSet.GetNamespacePrefixes(); Console.WriteLine(); foreach (var prefix in prefixes) { writer.WriteLine($"{prefix.Name,9}: -> \"{prefix.Namespace}\""); } }