Subject: RE: [xsl] ShoXS: a Shorter XSL Syntax From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 4 Jun 2002 23:26:37 +0100 |
You seem to have developed this independently from Paul T's XSLScript, see http://www.pault.com/pault/prod/XSLScript Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Remco Bouckaert > Sent: 04 June 2002 20:28 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] ShoXS: a Shorter XSL Syntax > > > The last two year I have been doing quite a bit of > XSL scripting, but after a while I found the > syntax to be a bit too verbose to my taste. So, to > help do the scripting I put together a little tool > that translates XSL to a more compact syntax, edit > in that syntax and translate back to XSL. This syntax > is ShoXS (SHOrter Xsl Syntax, you get it:-). > > ShoXS is a bit Javascript-ish, as far as XSL allows > this. Just to give an impression, an XSL fragment > from the XSL FAQ and its ShoXS equivalent: > > ===============================XSL=============================== > > <xsl:template name="displayyear"> > <xsl:param name="yearlist"/> > <xsl:variable name="year" > select="substring-before($yearlist,',')"/> > <xsl:choose> > <xsl:when test="string-length($year) > 0"> > <td><xsl:value-of select="$year"/></td> > <xsl:call-template name="displayyear"> > <xsl:with-param > name="yearlist"><xsl:value-of > select="substring-after($yearlist,',')"/> > </xsl:with-param> > </xsl:call-template> > </xsl:when> > <xsl:otherwise> > <td><xsl:value-of select="$yearlist"/></td> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > ===============================ShoXS============================== > > fun displayyear { > par yearlist=""{} > var year="substring-before($yearlist,',')"{} > switch { > case(string-length($year) > 0) { > <td>val($year)</td> > call displayyear { > wpar yearlist=""{val(substring-after($yearlist,',')) > } > } > } > default{ > <td>val($yearlist)</td> > } > } > } > > =================================================================== > > If you want to see a bit more about ShoXS, have > a browse on http://www.xm.co.nz/ShoXS.htm where you > can find ShoXSPad, a notepad like tool to toggle between > XSL and ShoXS. A bit more useful is a version integrated > in jEdit, which I use myself. > > It should be easy to get to grips with ShoXS if you know XSL: > just key in the XSL, toggle to ShoXS and look at the ShoXS > equivalent. > > Let me know if you have any constructive comments or > suggestions (or find any bugs). > > Enjoy, > > Remco > rrb@xxxxxxxx > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] ShoXS: a Shorter XSL Syntax, Remco Bouckaert | Thread | Re: [xsl] ShoXS: a Shorter XSL Synt, Remco Bouckaert |
RE: [xsl] What is %26 doing in my H, Michael Kay | Date | Re: [xsl] Processing HTML document., David Carlisle |
Month |