-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.Xmldoc-bugProblem with the content; needs to be fixedProblem with the content; needs to be fixed
Description
Issue description
The docs says that the return value of XmlNamespaceManager.LookupPrefix returns The matching prefix. If there is no mapped prefix, the method returns String.Empty. If a null value is supplied, then null is returned.
My tests indicate that this method returns null if there is no mapped prefix.
Example:
XmlNamespaceManager mgr = new XmlNamespaceManager(new NameTable());
var prefix = mgr.LookupPrefix("http://www.microsoft.com");
if (prefix == null)
Console.WriteLine("Prefix is null");
else
Console.WriteLine("Prefix is not null");
This code outputs "Prefix is null". According to the docs the returned prefix should have been String.Empty.
Target framework
- .NET Core 5.0
- .NET Framework 4.8
dotnet --info output or About VS info
<replace>
Metadata
Metadata
Assignees
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.Xmldoc-bugProblem with the content; needs to be fixedProblem with the content; needs to be fixed