Altova Mailing List Archives


RE: [xsl] need help with converting attribute into elements

From: Rod Humphris - FLPTN <rod.humphris@-------------->
To:
Date: 10/14/2003 1:07:00 AM
Hi Ales

I expect someone could suggest a prettier and more modular approach but
nested choose blocks would do it:

<xsl:template match="text">
 <p>
  <xsl:choose>
   <xsl:when test="@bold='true'">
    <b>
     <xsl:choose>
      <xsl:when test="@italic='true'">
       <i>
         etc, etc.....
    </b>
   </xsl:when>
   <xsl:otherwise>
  
   </xsl:otherwise> 
  </xsl:choose>
 </p>
</xsl:template>

Cheers

Rod


-----Original Message-----
From: Ale&sup1; Peregrin [mailto:ales.peregrin@xxxxxxxxxx]
Sent: 14 October 2003 09:47
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] need help with converting attribute into elements


Hi!
I'm trying to make a XSLT stylexheet for transforming XML document into HTML
and there is a problem I'm unable to solve, even after a week of trying and
searching all over the internet. The problem looks quite easy to me and it
seems I'm missing something important about XSL  language. Here it goes:

I have an XML tag which looks like this: <text bold=true italic=true
underline=false>Help!</text>
In this case, the result in HTML should be:
<font>
   <b>
      <i>
         Help!
      </i>
   </b>
</font>

I simply need to transform the attributes into HTML elements so that any of
the possible combinations of the atributes' values would be transformed
correctly.

Can anyone help me?
Thanx.
Ales Peregrin


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


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________


________________________________________________________________
Any opinions expressed in this email are those of the individual and not necessarily the Company. Unless expressly stated to the contrary, this email is not intended to give rise to a new, or affect an existing, contractual or other legal relationship.This email and any files transmitted with it, including replies and forwarded copies which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. The unauthorised use, disclosure or copying of this email, or any other information contained or attached,is prohibited and could, in certain circumstances, be a criminal offence.

If you have received this email in error please notify the sender as soon as possible.

This footnote also confirms that this email message has been swept for the presence of computer viruses.

www.focusdiy.co.uk
_________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.