1 //------------------------------------------------------------------------------
2 // <copyright file="IXmlNamespaceResolver.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
9 using System.Collections;
10 using System.Collections.Generic;
12 namespace System.Xml {
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 {
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
24 // Return the namespace to which the specified prefix is mapped. Returns null if the prefix isn't mapped to
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);
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);