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

XSLT 2.0 Typing (Was: RE: Re: XSLT 2.0: On xsl:sequenc

Subject: XSLT 2.0 Typing (Was: RE: Re: XSLT 2.0: On xsl:sequence and xsl:copy-of )
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 13 Oct 2003 06:31:37 -0700 (PDT)
sequenc
> Ok. So (and I think I've asked this before and Mike quoted ?I think?
> xsd rec) where is the full list of ' data types' in the current raft of
> specs?
> 
> http://www.dpawson.co.uk/xsl/rev2/exampler.html#iof
> lists the ones I guessed at.
> 
> > I couldn't find one, so I guess as with Dimitres 'misnaming',
> > I (we?) will be fumbling with data types until we've guessed them all?
> > 
> > 
> > >  
> > >  > the anonymous type?
> > >  
> > >  Your getting your terminology confused 
> > 
> > Yes, you're probably right Jeni... but I'm not surprised,
> > its got to be closer to xsl-fo complexity than xslt 1?
> > 
> > Not getting at you Jeni, honest.

In XSLT, as in other programming languages, typing can be very useful.

I personally have already benefitted by XSLT 2.0 typing. In particular, it
allows me to eliminate code, which in XSLT 1.0 was necessary, e.g. to
check if a node-set passed as parameter is empty and then issue an error
message:

Instead of:

<xsl:template name="foldl1">
  <xsl:param name="pFunc" select="/.."/>
  <xsl:param name="pList" select="/.."/>

  <xsl:choose>
     <xsl:when test="not($pList)">
      <xsl:message terminate="yes">Some strong words!!!</xsl:message>
     </xsl:when>
     <xsl:otherwise>useful code here</xsl:otherwise>


I now can simply write:

<xsl:function name="f:foldl1">
  <xsl:param name="pFunc" as="element()"/>
  <xsl:param name="pList" as="item()+"/>

  <!-- useful code here -->

This is a significant reduction of the complexity of the code and the
total number of lines. As result the code is simpler, more easier to write
and understand, programmer productivity is increased.




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


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