CoreTween v1.0.0 beta 2 available

For the past week I’ve been working hard on the CoreTween website and the CoreTween library. Small changes where made to the CoreTween library and a new reference section has been added to the website.

One of the problems I was facing with the CoreTween reference documentation was the fact that CoreTween supports four different languages. Because 90% of the documentation is the same for all four languages I need some sort of scheme that wouldn’t involve duplicating any data. My first choice was of course to store the reference documentation in a good ‘ol database. But to do that effectively I also needed some sort of CMS through which I easily could fill this database. No of the shelf solution fitted this so I reverted to another solution.

For a long time I’ve been wanting to do more (and learn more about) XSLT. This fascinating XML technology has been on my mind a lot lately and so I decided that this would be a good time to start using it. The reference documentation for CoreTween is therefore stored in a simple plain XML document which is easy to edit with a normal text editor. The XML Stylesheet then converts this XML document to the appropriate HTML document containing the correct implementation language (ActionScript 1, 2, 3 or haXe). Within the XML document there are tags that look like this:

<if>
   <as3>
      void
   </as3>
   <otherwise>
      Void
   </otherwise>
</if>

This way its easy to specify only the differences between the supported programming languages and keep all the other stuff the same. The XML Stylesheet takes care of filtering the <if> tags to the correct value. These vales are passed from the URL to the PHP script that executes the XSLT processor. Try a sample of the TweenManager class for a demonstration. To change to implementation language, simply change the ‘language’ parameter on the URL to as1, as2, as3 or haxe. Follow this link to have a look inside the TweenManager XML document that defines the reference documentation.

Of course, on the final website you can easily change between implementation languages. But that’s still in the works.

Comments are closed.