Re: AW: [xsl] '<' and '>' in the value of a variable

Subject: Re: AW: [xsl] '<' and '>' in the value of a variable
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Fri, 01 Aug 2003 16:08:23 +0100 (WEST)
Hi.

Citando Ming Yu <myu@xxxxxxxx>:

} The reason I need to do this is because I have a template function like this:
} 
} <xsl:template name="printRawData">
}      <xsl:param name="field_label"/>
}      <xsl:param name="field"/>
}      <xsl:param name="html"/>
}      <xsl:param name="bold"/>
}      <xsl:param name="endbold"/>
}      <xsl:param name="return"/>
} 
}      <xsl:if test="string-length($field) &gt; 0">

you'll just need to check if bold is not empty and create the element

instead of this:
}          <xsl:value-of select="$bold"/>
}          <xsl:value-of select="$field_label"/>
}          <xsl:value-of select="$endbold"/>
}          <xsl:value-of select="xmlconf:convertLWWEntities($field)"/>

do:
           <xsl:choose>
             <xsl:when test="string($bold)">
               <xsl:element name="{$bold}">
                 <xsl:value-of select="$field_label"/>
               </xsl:element>
             </xsl:when>
             <xsl:otherwise>
               <xsl:value-of select="$field_label"/>
             </xsl:otherwise>
           </xsl:choose>
           <xsl:value-of select="xmlconf:convertLWWEntities($field)"/>

}      </xsl:if>
}      <xsl:value-of select="$return"/>
} 
} </xsl:template>
} 

(...)

Regards,
Americo Albuquerque

___________________________________________________________________

O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt


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


Current Thread