July 2006 Entries

  • Mental note: MaxItems with XSLT

    Probably old news/code, but I couldn't find it when I went looking for it. I wanted to have an XSLT stylesheet that only displayed 'n' items from the source (in this case RSS). Here's the important bits: The template:  <xsl:template match="item">   <xsl:param name="maxItems"/>   <xsl:if test="count(preceding::item) &lt; $maxItems">    <div id="itemWrapper">     <xsl:if test="position() mod 2">      <xsl:attribute name="id">itemWrapperHighlight</xsl:attribute>     </xsl:if>     <h3 id="itemTitle">      <xsl:value-of select="title"/>     </h3>     <div id="itemBody">      <xsl:value-of select="description"/>      <br/>      <a>       <xsl:attribute name="href"><xsl:value-of select="url"/></xsl:attribute>       <xsl:attribute name="alt"><xsl:value-of select="title"/></xsl:attribute>    Read more of this item     </a>     </div>    </div>   </xsl:if>  </xsl:template> The important bit in that is the line: . The "item" should be whatever expression is used to define the template. That is, "item" isn't a keyword in this case, but the...

  • Project 'X' in the can

    Files sent to the editor, so it means that the hardest part of Project 'X' is complete. I can go back to having idle weekends and evenings, and stop ignoring customers. Feels good, and I feel like spouting off a Ricky quote or two right about now. I really don't know how Dino, Bill and the other frequent repeat offenders do it. Look for actual technical content over the next few days, as I peel a few examples out, and get back to "real coding".

  • Advice for public speakers

    Instead of thinking of your audience in their underwear, think of them as targets.

  • Write code, win stuff

    I don't get to code anywhere near as much as I'd like/should these days, but for those who do, there are a number of contests on you may or may not be aware of:DotNetSlackers -- already a great source of information that I look forward to receiving each day -- is offering an MSDN subscription just for writing an "Atlas" control or extender. Another great resource, Mike Gunderloy's Larkware Daily, is having a contest to prepare for his upcoming 1000th post. If you've ever tried to post daily, you know how difficult it is, but to carry on for almost three...