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