Cocoon/a1.xsl

From Fxp Wiki

Jump to: navigation, search
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:template match="/">
  <html>
    <head></head><body>
 
<script>
 
function add_notion(notion) {
window.opener.top.document.frames['gen'].frames['beta'].document.forms['f1'].elements[0].value= notion
}
 
function display2() {
    var range = document.selection.createRange();
    var str = range.text;
  window.opener.top.document.frames['gen'].frames['beta'].document.forms['f1'].elements[1].value = str;
}
</script>
 
  <xsl:apply-templates/>
</body></html>
</xsl:template>
 
<xsl:template match="div">
  <div>
    <xsl:attribute name="onclick">add_notion(&quot;<xsl:value-of select="@id"/>&quot;)</xsl:attribute>
    <xsl:attribute name="onmouseup">display2()</xsl:attribute>
   <xsl:apply-templates mode="insert-data"/>
  </div>
</xsl:template>
 
 
<xsl:template match="rs" mode="insert-data">
<i>
  <xsl:apply-templates mode="insert-data"/>
</i>
</xsl:template>
 
 
 
<xsl:template match="div[@id='N01-1']" mode="insert-data">
  <xsl:apply-templates mode="insert-data"/>
</xsl:template>
 
<xsl:template match="div[@id='N01-1']/text()" mode="insert-data">
  <xsl:call-template name="insert1">
    <xsl:with-param name="insert">
	<xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
 
<xsl:template match="div[@id='N01-1']/title" mode="insert-data">
 <h1>
  <xsl:value-of select="."/>
  <xsl:apply-templates/>
</h1>
</xsl:template>
 
<xsl:template name="insert1">
<xsl:param name="insert"/>
  <xsl:call-template name="insert2">
    <xsl:with-param name="insert">
<xsl:value-of select="substring-before($insert, 'personnes')" />
&lt;font color=&apos;#006600&apos;&gt;http://www.dpawson.co.uk/xsl/sect2/replace.html&lt;/font&gt;
personnes
<xsl:value-of select="substring-after($insert, 'personnes')" />
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
 
 
<xsl:template name="insert2">
<xsl:param name="insert"/>
  <xsl:call-template name="last">
    <xsl:with-param name="insert">
<xsl:value-of select="substring-before($insert, 'veut')" />
&lt;font color=&apos;red&apos;&gt;HELLO&lt;/font&gt;
veut
<xsl:value-of select="substring-after($insert, 'veut')" />
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
 
 
<xsl:template name="last">
<xsl:param name="insert"/>
<xsl:value-of select="$insert" disable-output-escaping="yes"/>
</xsl:template>
 
 
</xsl:stylesheet>
 
Personal tools