private string GetHelpMaml(XmlDocument document, string key, string verb, string noun)
{
XmlNamespaceManager nsmgr = new XmlNamespaceManager(document.NameTable);
nsmgr.AddNamespace("cmd", "http://schemas.microsoft.com/maml/dev/command/2004/10");
string xpath = String.Format(
"/helpItems/providerHelp/CmdletHelpPaths/CmdletHelpPath[@ID='{0}']/cmd:command[ ./cmd:details[ (cmd:verb='{1}') and (cmd:noun='{2}') ] ]",
key,
verb,
noun);
XmlNode node = null;
try
{
node = document.SelectSingleNode(xpath, nsmgr);
}
catch (XPathException)
{
return string.Empty;
}
if (node == null)
{
return String.Empty;
}
return node.OuterXml;
}