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

Re: Transform some attributes into HTML span elements

Subject: Re: Transform some attributes into HTML span elements with delimiters (specific format)
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Thu, 27 May 2010 15:12:20 -0700 (PDT)
Re:  Transform some attributes into HTML span elements
Mukul Gandhi wrote:

  Hi,

> I think, I would have done this as following:

>
<xsl:template match="InspectionReportInput">
>   <span
id="firstName"><xsl:value-of select="@firstName"
> /></span> <span
id="lastName"><xsl:value-of select="@lastName"
>
/><xs:text>, </xsl:text><xsl:value-of select="@city" />
> </xsl:template>

  I
am always surprised to see that many people try very hard to
be "more
concise", even when that ends up less readable.  Why not
simply that?:
<!--
        Format an inspection report element by using the
appropriate SPAN elements and text separators.
    -->
    <xsl:template
match="InspectionReportInput">
       <span id="firstName">
<xsl:value-of select="@firstName"/>
       </span>
       <xsl:text>
</xsl:text>
       <span id="lastName">
          <xsl:value-of
select="@lastName"/>
       </span>
       <xs:text>, </xsl:text>
       <span
id="city">
          <xsl:value-of select="@city"/>
       </span>
</xsl:template>

  Regards,

-- 
Florent Georges
http://fgeorges.org/

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-2011 All Rights Reserved.