The Labs \ Source Viewer \ SSCLI \ System.Xml \ IXmlNamespaceResolver

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IXmlNamespaceResolver.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System;
  16. using System.Collections;
  17. using System.Collections.Generic;
  18. namespace System.Xml
  19. {
  20.    
  21.     // Provides read-only access to a set of (prefix, namespace) mappings. Each distinct prefix is mapped to exactly
  22.     // one namespace, but multiple prefixes may be mapped to the same namespace (e.g. xmlns:foo="ns" xmlns:bar="ns").
  23.     public interface IXmlNamespaceResolver
  24.     {
  25.        
  26.         #pragma warning disable 3002
  27.         // Returns a collection of defined prefix-namespace mappings.
  28.         IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope);
  29.         #pragma warning restore 3002
  30.        
  31.         // Return the namespace to which the specified prefix is mapped. Returns null if the prefix isn't mapped to
  32.         // a namespace.
  33.         // The "xml" prefix is always mapped to the "http://www.w3.org/XML/1998/namespace" namespace.
  34.         // The "xmlns" prefix is always mapped to the "http://www.w3.org/2000/xmlns/" namespace.
  35.         // If the default namespace has not been defined, then the "" prefix is mapped to "" (the empty namespace).
  36.         string LookupNamespace(string prefix);
  37.        
  38.         // Return a prefix which is mapped to the specified namespace. Multiple prefixes can be mapped to the
  39.         // same namespace, and it is undefined which prefix will be returned. Returns null if no prefixes are
  40.         // mapped to the namespace.
  41.         // The "xml" prefix is always mapped to the "http://www.w3.org/XML/1998/namespace" namespace.
  42.         // The "xmlns" prefix is always mapped to the "http://www.w3.org/2000/xmlns/" namespace.
  43.         // If the default namespace has not been defined, then the "" prefix is mapped to "" (the empty namespace).
  44.         string LookupPrefix(string namespaceName);
  45.     }
  46. }

Developer Fusion