IXmlNamespaceResolver.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //------------------------------------------------------------------------------
  2. // <copyright file="IXmlNamespaceResolver.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">helenak</owner>
  6. //------------------------------------------------------------------------------
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. namespace System.Xml {
  11. // Provides read-only access to a set of (prefix, namespace) mappings. Each distinct prefix is mapped to exactly
  12. // one namespace, but multiple prefixes may be mapped to the same namespace (e.g. xmlns:foo="ns" xmlns:bar="ns").
  13. public interface IXmlNamespaceResolver {
  14. // This pragma disables a warning that the return type is not CLS-compliant, but generics are part of CLS in Whidbey.
  15. #pragma warning disable 3002
  16. // Returns a collection of defined prefix-namespace mappings.
  17. IDictionary<string,string> GetNamespacesInScope( XmlNamespaceScope scope );
  18. #pragma warning restore 3002
  19. // Return the namespace to which the specified prefix is mapped. Returns null if the prefix isn't mapped to
  20. // a namespace.
  21. // The "xml" prefix is always mapped to the "http://www.w3.org/XML/1998/namespace" namespace.
  22. // The "xmlns" prefix is always mapped to the "http://www.w3.org/2000/xmlns/" namespace.
  23. // If the default namespace has not been defined, then the "" prefix is mapped to "" (the empty namespace).
  24. string LookupNamespace(string prefix);
  25. // Return a prefix which is mapped to the specified namespace. Multiple prefixes can be mapped to the
  26. // same namespace, and it is undefined which prefix will be returned. Returns null if no prefixes are
  27. // mapped to the namespace.
  28. // The "xml" prefix is always mapped to the "http://www.w3.org/XML/1998/namespace" namespace.
  29. // The "xmlns" prefix is always mapped to the "http://www.w3.org/2000/xmlns/" namespace.
  30. // If the default namespace has not been defined, then the "" prefix is mapped to "" (the empty namespace).
  31. string LookupPrefix(string namespaceName);
  32. }
  33. }