这个XPath表达式挣扎,基本上我需要提取从一块这样的XAML程序集名称:
<Modularity:ModuleCatalog
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Modularity="clr-namespace:Microsoft.Practices.Prism.Modularity;assembly=Microsoft.Practices.Prism"
xmlns:AppInfo="clr-namespace:Example.Common.Services.Prism.Modularity;assembly=Example.Common.Services">
<Modularity:ModuleInfoGroup InitializationMode="OnDemand">
<AppInfo:ApplicationModuleInfo
ModuleName="Administration"
ModuleType="Example.UI.Administration.AdministrationModule, Example.UI.Administration, Version=1.2.1.1, Culture=neutral, PublicKeyToken=537c3450b3658434"
Ref="Example.UI.Administration.xap" />
<AppInfo:ApplicationModuleInfo
ModuleName="Prescribing"
ModuleType="Example.UI.Prescribing.PrescribingModule, Example.UI.Prescribing, Version=1.24.2.1, Culture=neutral, PublicKeyToken=537c3450b3658434"
Ref="Example.UI.Prescribing.xap" />
<AppInfo:ApplicationModuleInfo
ModuleName="SampleModule"
ModuleType="Example.UI.SampleModule.SampleModuleModule, Example.UI.SampleModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=537c3450b3658434"
Ref="Example.UI.SampleModule.xap" />
</Modularity:ModuleInfoGroup>
</Modularity:ModuleCatalog>
我基本上是试图在"Example.UI.SampleModule"等的那一刻,我的表达如下:
但它看起来好像被完全地忽略中的子仍发现完整类型名。我想知道,如果使用"。"作为当前转换是正确的事情吗? i.e .//*[local-name() = 'ApplicationModuleInfo']/@ModuleType[substring-after(., ',')][substring-before(.,',')]
"。"纠正?substring-before(., ",")