У меня есть следующий XML-файл
<ScheduleProvider id="257" scheduleDate="2008-03-20T15:34:18Z" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.xsd">
<Content action="insert" duration="7200" id="2" title="movie-2">
<EpgDescription>
<EpgElement key="Year">2002</EpgElement>
<EpgElement key="Actors">Actor2 Actor22</EpgElement>
<EpgElement key="Directors">Director2</EpgElement>
<EpgElement key="Rating">2</EpgElement>
</EpgDescription>
<EpgDescription locale="en_US">
<EpgElement key="Title">Blockbuster-2</EpgElement>
</EpgDescription>
<Media comment="" fileName="Asset_2" format="AV_ClearTS" frameDuration="180000" id="LYS008168695" title="Asset_2">
<TechnicalMetadata key="ReadyForBroadcast">4</TechnicalMetadata>
<TechnicalMetadata key="Subtitle_Languages"/>
</Media>
</Content>
<Content action="insert" duration="7200" id="1" title="movie-1">
<EpgDescription>
<EpgElement key="Year">2001</EpgElement>
<EpgElement key="Actors">Actor1 Actor11</EpgElement>
<EpgElement key="Directors">Director1</EpgElement>
<EpgElement key="Rating">1</EpgElement>
</EpgDescription>
<EpgDescription locale="en_US">
<EpgElement key="Title">Blockbuster-1</EpgElement>
</EpgDescription>
<Media comment="" fileName="Asset_1" format="AV_ClearTS" frameDuration="180000" id="LYS008168695" title="Asset_1">
<TechnicalMetadata key="ReadyForBroadcast">4</TechnicalMetadata>
<TechnicalMetadata key="Subtitle_Languages"/>
</Media>
</Content>
</ScheduleProvider>
Можно ли отсортировать узлы Content по атрибуту id ? Я ожидаю следующий результат
<ScheduleProvider id="257" scheduleDate="2008-03-20T15:34:18Z" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.xsd">
<Content action="insert" duration="7200" id="1" title="movie-1">
<EpgDescription>
<EpgElement key="Year">2001</EpgElement>
<EpgElement key="Actors">Actor1 Actor11</EpgElement>
<EpgElement key="Directors">Director1</EpgElement>
<EpgElement key="Rating">1</EpgElement>
</EpgDescription>
<EpgDescription locale="en_US">
<EpgElement key="Title">Blockbuster-1</EpgElement>
</EpgDescription>
<Media comment="" fileName="Asset_1" format="AV_ClearTS" frameDuration="180000" id="LYS008168695" title="Asset_1">
<TechnicalMetadata key="ReadyForBroadcast">4</TechnicalMetadata>
<TechnicalMetadata key="Subtitle_Languages"/>
</Media>
</Content>
<Content action="insert" duration="7200" id="2" title="movie-2">
<EpgDescription>
<EpgElement key="Year">2002</EpgElement>
<EpgElement key="Actors">Actor2 Actor22</EpgElement>
<EpgElement key="Directors">Director2</EpgElement>
<EpgElement key="Rating">2</EpgElement>
</EpgDescription>
<EpgDescription locale="en_US">
<EpgElement key="Title">Blockbuster-2</EpgElement>
</EpgDescription>
<Media comment="" fileName="Asset_2" format="AV_ClearTS" frameDuration="180000" id="LYS008168695" title="Asset_2">
<TechnicalMetadata key="ReadyForBroadcast">4</TechnicalMetadata>
<TechnicalMetadata key="Subtitle_Languages"/>
</Media>
</Content>
</ScheduleProvider>
Я слышал о xsl: sort и немного поиграл с ним. Но у меня нет опыта работы с xslt, и я не могу понять, как использовать xsl: sort .