<rules xmlns="http://namespaces.plone.org/xdv" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Head: title,base,styles and js -->
<!--  <prepend theme="/html/head/base" content="/html/head/base/@*" />
  <before theme="/html/head/meta[@name='xdv-meta']" content="/html/head/meta" />
  <before theme="/html/head/meta[@name='xdv-link']" content="/html/head/link[@rel='stylesheet']" />
  <before theme="/html/head/meta[@name='xdv-css']" content="/html/head/style" />
  <before theme="/html/head/meta[@name='xdv-js']" content="/html/head/script" />
  <before theme="/html/head/meta[@name='xdv-link']" content="/html/head/link" />
-->
  <!-- delete mktcss (only for usage under /mkt path, controlled by another rules file)-->
  <drop theme="/html/head/link[@id='mktcss']" />  


  <prepend theme="/html/head" content="/html/head/*"/>

  <!-- google analytics -->
  <append theme="/html/head" content="//*[contains(@id,'include')]"/>

  <!-- copy body attributes -->
  <prepend theme="/html/body" content="/html/body/@*" />

  <!-- copy personaltools and searchbox -->
  <replace theme="//*[@id='portal-personaltools']" content="//*[@id='portal-personaltools']" />
  <replace theme="//*[@id='portal-searchbox']" content="//*[@id='portal-searchbox']" />

  <!-- language selector -->
  <after content="//*[@id='portal-languageselector']" theme="//*[@id='portal-personaltools-wrapper']" />
  
  <!-- copy portal logo attributes -->
  <prepend theme="//a[@id='portal-logo']" content="//a[@id='portal-logo']/@*" />


  <!-- copy globalnav preserving no-whitespace between elements -->
  <append theme="//*[@id='portal-globalnav']" >
    <xsl:for-each select="//*[@id='portal-globalnav']">
      <xsl:copy-of select="*"/><xsl:text> </xsl:text>
    </xsl:for-each>
  </append>


  <!-- copy breadcrumbs & messages -->
  <replace theme="//*[@id='portal-breadcrumbs']" content="//*[@id='portal-breadcrumbs']" />
  <replace theme="//*[@id='kssPortalMessage']" content="//*[@id='kssPortalMessage']" />

  <!--edit mode -->
  <prepend theme="//div[@id='editplaceholder']" content="//*[@id='content']/../@*" />
  <drop theme="//*[@id='edit-bar']" if-content="not(//div[@class='documentEditable'])"/>
  <replace theme="//*[@id='edit-bar']" content="//*[@id='edit-bar']" />



<!-- special estudios TODO: move to a special rules file just for estudios-->
<!--<before theme="//*[@id='portal-column-two']/*" content="//*[contains(@class,'pfg-form')]"/>-->

  <!-- copy content -->
  <append theme="//*[@id='content']" content="//*[@id='content']/*" />
  <!-- copy content tag attrs -->
  <prepend theme="//*[@id='content']" content="//*[@id='content']/@*" />

  <!-- copy content column two -->
  <append theme="//*[@id='portal-column-two']" content="//*[@id='portal-column-two']/*" />
  <!-- copy content tag attrs -->
  <prepend theme="//*[@id='portal-column-two']" content="//*[@id='portal-column-two']/@*" />

<!-- MOVE HACK http://plone.293351.n2.nabble.com/Re-xdv-question-td5811513.html -->
<!--if-content="//base[not(contains(@href,'alumnes'))]"-->
<drop content="//*[contains(@class,'pfg-form')]"/>
<prepend theme="//*[@id='portal-column-two']"><xsl:copy-of select="//*[contains(@class,'pfg-form')]"/></prepend>


<!-- MOVE HACK http://plone.293351.n2.nabble.com/Re-xdv-question-td5811513.html -->
<!--<drop content="//*[contains(@class,'pfg-form')]"/>
<prepend theme="//*[@id='portal-column-two']"><xsl:copy-of select="//*[contains(@class,'pfg-form')]"/></prepend>-->


<!-- MOVE HACK http://plone.293351.n2.nabble.com/Re-xdv-question-td5811513.html 
     + XPATH FIND ELS. BETWEEN TWO NODES
-->
<drop content="//*[preceding-sibling::*[contains(@class,'documentDescription')]  and following-sibling::*[contains(@class,'pfg-form')]]"/>
<prepend theme="//*[@id='portal-column-two']"><xsl:copy-of 
  select="//*[preceding-sibling::*[contains(@class,'documentDescription')]  and following-sibling::*[contains(@class,'pfg-form')]]"/></prepend>


<!-- MOVE HACK http://plone.293351.n2.nabble.com/Re-xdv-question-td5811513.html 
     + XPATH FIND ELS. BETWEEN TWO NODES
-->
<!--
<drop content="//*[@id='content']//object"/>
<append theme="//*[@id='videoplaceholder']"><xsl:copy-of 
  select="//*[@id='content']//object"/></append>
-->

<!-- move news to ticker -->
<drop if-content="//body[contains(@class,'section-es')]"  content="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f65730a6e6f746963696173']" />
<append if-content="//body[contains(@class,'section-es')]"  theme="//*[@id='newsticker']"><xsl:copy-of 
  select="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f65730a6e6f746963696173']" /></append>

<!-- move news to ticker EN -->
<drop if-content="//body[contains(@class,'section-en')]"  content="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f656e0a6e657773']" />
<append if-content="//body[contains(@class,'section-en')]"  theme="//*[@id='newsticker']"><xsl:copy-of 
  select="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f656e0a6e657773']" /></append>

<!-- move news to ticker CA -->
<drop if-content="//body[contains(@class,'section-ca')]"  content="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f63610a6e6f746963696173']" />
<append if-content="//body[contains(@class,'section-ca')]"  theme="//*[@id='newsticker']"><xsl:copy-of 
  select="//*[@id='portletwrapper-706c6f6e652e7269676874636f6c756d6e0a636f6e746578740a2f7777772e66646d6f64612e636f6d2f63610a6e6f746963696173']" /></append>

  <!-- copy attributes to column content, useful for sidecolumns -->
  <prepend theme="//*[@id='portal-column-content']" content="//*[@id='portal-column-content']/@*" />
  <!-- copy sidecolumns -->
  <replace theme="//*[@id='portal-column-one']" content="//*[@id='portal-column-one']" />
  <!--<replace theme="//*[@id='portal-column-two']" content="//*[@id='portal-column-two']" />-->

  <!-- copy footer & colophon -->
<!--  <replace theme="//*[@id='portal-footer']" content="//*[@id='portal-footer']" /> -->
<!--<replace theme="//*[@id='portal-colophon']" content="//*[@id='portal-colophon']" />-->
  <!-- copy siteactions -->
  <replace theme="//*[@id='portal-siteactions']" content="//*[@id='portal-siteactions']" />

<!-- easyslider-->
  <replace theme="//*[@id='slider-container']" content="//*[@id='slider-container']" />



    <!-- borrar el slider en todas als paginas no home -->
    <drop if-content="//body[not(contains(@class,'section-escuela-de-negocios-ealde'))]" theme="//*[@id='slider1']" />
    <drop if-content="//body[not(contains(@class,'section-escuela-de-negocios-ealde'))]" theme="/html/head/script[@class='headslider']" />

<!-- eliminar ufv en paginas seleccionadas -->
<drop if-content="//title[contains(text(),'Máster en Dirección Comercial y Márketing')]" theme="//*[contains(@class, 'ufv')]" />
<drop if-content="//title[contains(text(),'Máster en Dirección y Gestión de Proyectos')]" theme="//*[contains(@class, 'ufv')]" />
<drop if-content="//title[contains(text(),'Máster en Dirección y Gestión del Capital Humano')]" theme="//*[contains(@class, 'ufv')]" />

<drop if-content="//title[contains(text(),'Máster en Dirección Financiera')]" theme="//*[contains(@class, 'ufv')]" />
<drop if-content= "//title[not(contains(text(),'Escuela de negocios EALDE')) and not(contains(text(),'Máster en Administración y Dirección de Empresas'))]" theme="//*[contains(@class, 'ufv')]" />


<!--new -->

<!--  <append theme="//div[@id='navcol1']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_1')]//div[contains(@class,'collage_item_1')]//div[contains(@class,'standard-document')]//ul" />
-->
<append theme="//div[@id='navcol1']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_1')]//div[contains(@class,'collage_item_1')]//div[contains(@class,'standard-document')]//div[contains(@class,'plain')]/*" />


<append theme="//div[@id='navcol2']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_2')]//div[contains(@class,'collage_item_1')]//div[contains(@class,'standard-document')]//div[contains(@class,'plain')]/*" />



<!-- portada noticias imagen -->
<prepend theme="//div[@id='newscol1a']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_3')]//div[contains(@class,'collage_item_1')]//div[contains(@class,'standard-topic')]//div[contains(@class,'tileItem')]" 
/>

<!-- portada noticias texto -->

<prepend theme="//div[@id='newscol1b']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_3')]//div[contains(@class,'collage_item_2')]//div[contains(@class,'standard-topic')]//div[contains(@class,'tileItem')]" />

<prepend theme="//div[@id='morenews']" content="//div[contains(@class,'row_1')]//div[contains(@class,'block_3')]//div[contains(@class,'collage_item_3')]//div[contains(@class,'standard-document')]//div[contains(@class,'plain')]" />


<!-- move cabecera estudios menu -->
<drop content="//div[contains(dl/dt//span/a/text(),'Cabecera')]" />
<append theme="//*[@id='menuestudios1']"><xsl:copy-of 
  select="//div[contains(dl/dt//span/a/text(),'Cabecera')]/dl/dd/div/*"/></append>

<drop content="//div/dl/dt[contains(span/text(),'Nav estudios')]" />




<!-- mosca news home-->
<xsl:template match="//div[contains(@class,'tileItem')]">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:copy-of select="node()"/>
  <img class="moscanews" src="/theme/images/News.png" alt="" />
  </xsl:copy>

</xsl:template>




</rules>

