[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Basic question: placing a link element inside a text?

Subject: Basic question: placing a link element inside a text?
From: "Hubert Holtz" <Turnhose_alt@xxxxxxx>
Date: Mon, 30 Dec 2002 11:42:50 +0100
xsl link element
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[@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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.