home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
MediaPortal Forums Francais
MediaPortal 1 - Support
EPG, le guide des programmes
Web EPG
WebEPG :qui s'en sert ?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="unknow21" data-source="post: 442999"><p>Voici le fichier xsl qui fusionne Arte et France 5 en ArteF5 (parmettrable au debut du fichier)</p><p>[code]<?xml version="1.0" encoding="ISO-8859-1"?></p><p><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> </p><p><xsl:output method="xml" encoding="ISO-8859-1"/></p><p> </p><p> </p><p> <xsl:variable name="NightChannelName">Arte</xsl:variable></p><p> </p><p> </p><p> </p><p> <xsl:variable name="DayChannelName">France 5</xsl:variable></p><p> </p><p> </p><p> </p><p> <xsl:variable name="NewChannelName">ArteF5 </xsl:variable></p><p> </p><p> </p><p> </p><p> <xsl:variable name="TimeStartDay">030000</xsl:variable></p><p> </p><p> </p><p> </p><p> <xsl:variable name="TimeStartNight">190000 </xsl:variable></p><p> </p><p> <xsl:output method="xml" encoding="iso-8859-1"/></p><p> <xsl:template match="/tv"> </p><p> &gt;?xml version="1.0" encoding="utf-8"?&lt; </p><p> <tv generator-info-name="WebEPG"></p><p> <xsl:apply-templates/> </p><p> </tv></p><p> </xsl:template ></p><p></p><p> <xsl:template match="channel" > </p><p> <xsl:choose></p><p> <xsl:when test="self::node()[display-name=$NightChannelName]"></p><p> </p><p> <xsl:copy> </p><p> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> </p><p> <xsl:element name="display-name"></p><p> <xsl:value-of select="$NewChannelName"/></p><p> </xsl:element></p><p> </xsl:copy></p><p> </xsl:when></p><p> <xsl:when test="self::node()[display-name=$DayChannelName]"></p><p> </p><p> </xsl:when></p><p> <xsl:otherwise></p><p> <xsl:copy-of select="self::node()"/></p><p> </xsl:otherwise></p><p> </xsl:choose> </p><p> </p><p> </xsl:template ></p><p></p><p> <xsl:template match="programme"></p><p> <xsl:variable name="NewChannelId" select="/tv/channel[display-name=NightChannelName]/@id" /></p><p> <xsl:variable name="DayChannelId" select="/tv/channel[display-name=DayChannelName]/@id"/> </p><p> <xsl:choose></p><p> <xsl:when test="self::node()[@id=$NewChannelId]"></p><p> </p><p> <xsl:if test="self::node()[number(substring(@start,7,6)) &lt; number($TimeStartDay) or number(substring(@start,7,6)) &gt; number($TimeStartNight)-4099 ]"></p><p> <xsl:copy-of select="self::node()"/> </p><p> </xsl:if></p><p> </xsl:when></p><p> <xsl:when test="self::node()[@id=$DayChannelId]"></p><p> </p><p> <xsl:if test="self::node()[number(substring(@start,7,6)) &gt; number($TimeStartDay)-4099 and number(substring(@start,7,6)) &lt; number($TimeStartNight)]"></p><p> <xsl:copy> </p><p> <xsl:attribute name="start"><xsl:value-of select="@start"/></xsl:attribute> </p><p> <xsl:attribute name="id">$DayChannelId</xsl:attribute> </p><p> <xsl:copy-of select="self::node()/child::*"/> </p><p> </xsl:copy> </p><p> </xsl:if></p><p> </xsl:when></p><p> <xsl:otherwise></p><p> <xsl:copy-of select="self::node()"/></p><p> </xsl:otherwise></p><p> </xsl:choose></p><p> </xsl:template> </p><p></xsl:stylesheet>[/code]</p><p></p><p>Et le source dotnet en c# qui permet d'appliquer ce xsl sur le tvguide:</p><p>[code] XmlReaderSettings settingsR = new XmlReaderSettings();</p><p> XmlWriterSettings settingsW = new XmlWriterSettings();</p><p> XslCompiledTransform t = new XslCompiledTransform(true);</p><p> t.Load("file.xsl"); </p><p> settingsR.ProhibitDtd = false;</p><p> settingsW.ConformanceLevel = ConformanceLevel.Fragment;</p><p> t.Transform(XmlReader.Create("TvGuideIn.xml",settingsR),XmlWriter.Create("TvGuideOut.xml",settingsW));[/code]</p><p></p><p>Je n'ai pas testé le resultat dans MP, car je n'ai pas de carte Tv sous la main <img src="http://www.mp-fr.com/forums/style_emoticons/<#EMO_DIR#>/sad.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p></blockquote><p></p>
[QUOTE="unknow21, post: 442999"] Voici le fichier xsl qui fusionne Arte et France 5 en ArteF5 (parmettrable au debut du fichier) [code]<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="ISO-8859-1"/> <xsl:variable name="NightChannelName">Arte</xsl:variable> <xsl:variable name="DayChannelName">France 5</xsl:variable> <xsl:variable name="NewChannelName">ArteF5 </xsl:variable> <xsl:variable name="TimeStartDay">030000</xsl:variable> <xsl:variable name="TimeStartNight">190000 </xsl:variable> <xsl:output method="xml" encoding="iso-8859-1"/> <xsl:template match="/tv"> >?xml version="1.0" encoding="utf-8"?< <tv generator-info-name="WebEPG"> <xsl:apply-templates/> </tv> </xsl:template > <xsl:template match="channel" > <xsl:choose> <xsl:when test="self::node()[display-name=$NightChannelName]"> <xsl:copy> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> <xsl:element name="display-name"> <xsl:value-of select="$NewChannelName"/> </xsl:element> </xsl:copy> </xsl:when> <xsl:when test="self::node()[display-name=$DayChannelName]"> </xsl:when> <xsl:otherwise> <xsl:copy-of select="self::node()"/> </xsl:otherwise> </xsl:choose> </xsl:template > <xsl:template match="programme"> <xsl:variable name="NewChannelId" select="/tv/channel[display-name=NightChannelName]/@id" /> <xsl:variable name="DayChannelId" select="/tv/channel[display-name=DayChannelName]/@id"/> <xsl:choose> <xsl:when test="self::node()[@id=$NewChannelId]"> <xsl:if test="self::node()[number(substring(@start,7,6)) < number($TimeStartDay) or number(substring(@start,7,6)) > number($TimeStartNight)-4099 ]"> <xsl:copy-of select="self::node()"/> </xsl:if> </xsl:when> <xsl:when test="self::node()[@id=$DayChannelId]"> <xsl:if test="self::node()[number(substring(@start,7,6)) > number($TimeStartDay)-4099 and number(substring(@start,7,6)) < number($TimeStartNight)]"> <xsl:copy> <xsl:attribute name="start"><xsl:value-of select="@start"/></xsl:attribute> <xsl:attribute name="id">$DayChannelId</xsl:attribute> <xsl:copy-of select="self::node()/child::*"/> </xsl:copy> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:copy-of select="self::node()"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>[/code] Et le source dotnet en c# qui permet d'appliquer ce xsl sur le tvguide: [code] XmlReaderSettings settingsR = new XmlReaderSettings(); XmlWriterSettings settingsW = new XmlWriterSettings(); XslCompiledTransform t = new XslCompiledTransform(true); t.Load("file.xsl"); settingsR.ProhibitDtd = false; settingsW.ConformanceLevel = ConformanceLevel.Fragment; t.Transform(XmlReader.Create("TvGuideIn.xml",settingsR),XmlWriter.Create("TvGuideOut.xml",settingsW));[/code] Je n'ai pas testé le resultat dans MP, car je n'ai pas de carte Tv sous la main [img]http://www.mp-fr.com/forums/style_emoticons/<#EMO_DIR#>/sad.gif[/img] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
MediaPortal Forums Francais
MediaPortal 1 - Support
EPG, le guide des programmes
Web EPG
WebEPG :qui s'en sert ?
Contact us
RSS
Top
Bottom