@@ -18,11 +18,11 @@ public void ProduceNameAndSynopsis()
18
18
## Synopsis
19
19
This is Synopsis
20
20
" ) ;
21
- string [ ] name = GetXmlContent ( maml , "/helpItems/command:command/command:details/command:name" ) ;
21
+ string [ ] name = GetXmlContent ( maml , "/msh: helpItems/command:command/command:details/command:name" ) ;
22
22
Assert . Equal ( 1 , name . Length ) ;
23
23
Assert . Equal ( "Get-Foo" , name [ 0 ] ) ;
24
24
25
- string [ ] synopsis = GetXmlContent ( maml , "/helpItems/command:command/command:details/maml:description/maml:para" ) ;
25
+ string [ ] synopsis = GetXmlContent ( maml , "/msh: helpItems/command:command/command:details/maml:description/maml:para" ) ;
26
26
Assert . Equal ( 1 , synopsis . Length ) ;
27
27
Assert . Equal ( "This is Synopsis" , synopsis [ 0 ] ) ;
28
28
}
@@ -43,7 +43,7 @@ public void ProduceMultilineDescription()
43
43
And this is my last line.
44
44
" ) ;
45
45
46
- string [ ] description = GetXmlContent ( maml , "/helpItems/command:command/maml:description/maml:para" ) ;
46
+ string [ ] description = GetXmlContent ( maml , "/msh: helpItems/command:command/maml:description/maml:para" ) ;
47
47
Assert . Equal ( 3 , description . Length ) ;
48
48
}
49
49
@@ -59,11 +59,11 @@ This is Synopsis #hashtagNotAHeader.
59
59
I'm description
60
60
" ) ;
61
61
62
- string [ ] description = GetXmlContent ( maml , "/helpItems/command:command/maml:description/maml:para" ) ;
62
+ string [ ] description = GetXmlContent ( maml , "/msh: helpItems/command:command/maml:description/maml:para" ) ;
63
63
Assert . Equal ( 1 , description . Length ) ;
64
64
Assert . Equal ( "I'm description" , description [ 0 ] ) ;
65
65
66
- string [ ] synopsis = GetXmlContent ( maml , "/helpItems/command:command/command:details/maml:description/maml:para" ) ;
66
+ string [ ] synopsis = GetXmlContent ( maml , "/msh: helpItems/command:command/command:details/maml:description/maml:para" ) ;
67
67
Assert . Equal ( 1 , synopsis . Length ) ;
68
68
Assert . Equal ( "This is Synopsis #hashtagNotAHeader." , synopsis [ 0 ] ) ;
69
69
}
@@ -82,12 +82,12 @@ public void CanUseRelativeLinksInRelatedLinksSection()
82
82
[bar](bar://bar.md)
83
83
" ) ;
84
84
85
- string [ ] linkText = GetXmlContent ( maml , "/helpItems/command:command/command:relatedLinks/maml:navigationLink/maml:linkText" ) ;
85
+ string [ ] linkText = GetXmlContent ( maml , "/msh: helpItems/command:command/command:relatedLinks/maml:navigationLink/maml:linkText" ) ;
86
86
Assert . Equal ( 2 , linkText . Length ) ;
87
87
Assert . Equal ( "foo" , linkText [ 0 ] ) ;
88
88
Assert . Equal ( "bar" , linkText [ 1 ] ) ;
89
89
90
- string [ ] linkUri = GetXmlContent ( maml , "/helpItems/command:command/command:relatedLinks/maml:navigationLink/maml:uri" ) ;
90
+ string [ ] linkUri = GetXmlContent ( maml , "/msh: helpItems/command:command/command:relatedLinks/maml:navigationLink/maml:uri" ) ;
91
91
Assert . Equal ( 2 , linkUri . Length ) ;
92
92
Assert . Equal ( "" , linkUri [ 0 ] ) ; // empty, because foo.md is not a valid URI and help system will be unhappy.
93
93
Assert . Equal ( "bar://bar.md" , linkUri [ 1 ] ) ; // bar://bar.md is a valid URI
@@ -340,7 +340,7 @@ You can also use the PSSnapin property of the object that the Get-Command cmdlet
340
340
[about_PSSnapins]()
341
341
342
342
" ) ;
343
- string [ ] examples = GetXmlContent ( maml , "/ helpItems/command:command/command:examples/command:example/dev:code" ) ;
343
+ string [ ] examples = GetXmlContent ( maml , "msh: helpItems/command:command/command:examples/command:example/dev:code" ) ;
344
344
Assert . Equal ( 5 + 3 , examples . Length ) ;
345
345
}
346
346
@@ -358,6 +358,7 @@ public static string[] GetXmlContent(string xml, string xpath)
358
358
xmlns . AddNamespace ( "maml" , "http://schemas.microsoft.com/maml/2004/10" ) ;
359
359
xmlns . AddNamespace ( "dev" , "http://schemas.microsoft.com/maml/dev/2004/10" ) ;
360
360
xmlns . AddNamespace ( "MSHelp" , "http://msdn.microsoft.com/mshelp" ) ;
361
+ xmlns . AddNamespace ( "msh" , "http://msh" ) ;
361
362
362
363
XPathNodeIterator iterator = nav . Select ( xpath , xmlns ) ;
363
364
foreach ( var i in iterator )
0 commit comments