1

我必须使用 XSLT 从 XML 创建 Windows Phone 页面。这是 windows phone 页面中第一行的外观:

<phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:RssPhoneApp_ViewModels="clr-namespace:RssPhoneApp.ViewModels" 
x:Class="RssPhoneApp.MainPage"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">

而且我不知道如何在 phone:PhoneApplicationPage 和xmlns属性中使用“phone”前缀进行管理。我不知道这应该如何工作。

4

1 回答 1

1

我建议只是阅读 XSL,因为那里有大量的开发人员资源。这是一篇讨论如何在 XSL 中处理名称空间的文章

只需在样式表中声明并使用您需要的命名空间,XSLT 处理器就会

  • 将该命名空间声明放在结果文档的文档元素的开始标记中,并且

  • 将该命名空间的前缀放在该命名空间中任何结果树元素的标签中。

于 2012-12-07T17:33:01.437 回答