Ulink

Jirka Kosek jirka na kosek.cz
Čtvrtek Červen 27 17:06:19 CEST 2002


Jiri_Navratil na orcz.cz wrote:
> 
> Muj dotaz zni, lze-li pouzit v ulinku atributt target a nastavit jej napr.
> na "new" viz priklad ??
> Automaticky se mi totiz generuje s nastavenim "_top"
> 
> <ulink url="www.orcz.cz"  target="new">

Jestli chcete, aby se všechny odkazy otvíraly do nějakého okna, můžete
použít parametr stylů ulink.target=new. Pokud chcete každý odkaz do
jiného okna, můžete jméno cílového okna zapisovat například do attributu
role a pak si do souboru s úpravami stylu přidat následující šablonu:

<xsl:template match="ulink" name="ulink">
  <a>
    <xsl:if test="@id">
      <xsl:attribute name="name">
        <xsl:value-of select="@id"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:attribute name="href"><xsl:value-of
select="@url"/></xsl:attribute>
    <xsl:choose>
    <xsl:when test="@role">
      <xsl:attribute name="target">
        <xsl:value-of select="@role"/>
      </xsl:attribute>
    </xsl:when>
    <xsl:when test="$ulink.target != ''">
      <xsl:attribute name="target">
        <xsl:value-of select="$ulink.target"/>
      </xsl:attribute>
    </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="count(child::node())=0">
	<xsl:value-of select="@url"/>
      </xsl:when>
      <xsl:otherwise>
	<xsl:apply-templates/>
      </xsl:otherwise>
    </xsl:choose>
  </a>
</xsl:template>

-- 
-----------------------------------------------------------------
  Jirka Kosek  	                     
  e-mail: jirka na kosek.cz
  http://www.kosek.cz


Další informace o konferenci Docbook