xsl-list
[Top] [All Lists]

Basic question: placing a link element inside a text?

2002-12-30 03:42:50
Hy,

I think I'm lacking in some XSL basics, so I have a problem which is hopefully 
easy to solve.

I have a simple article with some parameters, and in this paramter I want to 
put some links,
but the final html file puts the link under the text and not at the position in 
the text.

Here my XML:

------------------------
<article>
 <sect1 lang="ger">
  <para> 
  
   Dem internationalen Anspruch tragen ein vorzüglicher Sprachunterricht, ein 
   <ulink url='http://localhost:8080/imi/main.xsp'>praktisches 
Studiensemester</ulink>
   
   im Ausland sowie ausgewählte Lehrveranstaltungen in englischer Sprache...
  </para>
...
-----------------------

So nothing exciting about this, and here my XSL try:



-----------------------
</xsl:template>

 <xsl:template match="sect1[(_at_)lang='ger']"> 
 
  <table border="0" cellspacing="0" cellpadding="0" width="630" 
id="sectBackground">
   <tr>
     <td>
      <xsl:apply-templates select="mediaobject"/> <br/>
     </td>
   </tr>
   
   <tr>
    <td>
     
        <xsl:for-each select="para">  
     <xsl:value-of select="." /> <br/><br/>      
     
    <xsl:for-each select="ulink">
       <xsl:variable name="ulink">
         <a>
           <xsl:attribute name="href"><xsl:value-of 
select="@url"/></xsl:attribute>
           <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:variable>
           <xsl:copy-of select="$ulink"/>
      </xsl:for-each>
     
        </xsl:for-each>
       
     </td>
   </tr>
   <xsl:apply-templates select="simplelist"/> 
  </table>
 </xsl:template>
--------------------------

So the result shows the text and the 'http://localhost:8080/imi/main.xsp' link 
under the text and not at
the right position in the text. I think it has something to do with these lines:

<xsl:for-each select="para">  
     <xsl:value-of select="." /> <br/><br/>      
     
    <xsl:for-each select="ulink">

So thanks for your help in advance.

Homer30


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>