![]() |
||||||||||||||||
|
Frequently Asked Questions
1. IntroductionThis is the ShoXS FAQ list. Visit the ShoXS Project page at http://www.xm.co.nz/ShoXS.htm to view the latest version of this document. Please feel free to contribute more questions (and answers) by sending an email to faq@xm.co.nz. 2. General2.1 What is ShoXS?ShoXS is a shorter syntax for XSL-T. Because XSL-T is rather verbose and may be hard to read, ShoXS is shorter and (by default) more C/C++/Java like. 2.2 Who maintains ShoXS?ShoXS was started by me (Remco Bouckaert, rrb@xm.co.nz). For now, I maintain ShoXS, but I do not have the intention to own it. I am open for any suggestions on how to make ShoXS a more open standard. 3. Getting Started3.1 Which platform is required for running ShoXS?Well, ShoXS is not a tool but a standard. ShoXSPad is an implementation in Java which can be integrated in jEdit. It has been tested with jEdit 4.0 and jdk1.3 and 1.4 on various 32-bit windows variants. 4. Net Resources4.1 Is there a home page?The home page is http://www.xm.co.nz/ShoXS.htm. 4.2 Is there a mailing list?Not at this stage. I would suggest that questions go to the XSL-T mailing list and if there is sufficient interest a new list can be started. 5 LearningHow to learn ShoXS?You can read the ShoXS specification. But, if you already know XSL-T, you can use ShoXSPad, key in an XSL-T expression and toggle between XSL-T and ShoXS mode. ShoXSPad translates betweeen XSL-T and ShoXS, immediately showing the ShoXS syntax. Which tools are available?See the tools page. How to learn XSL-T?Some tutorials/introductions can be found by w3schools, Wei Meng LEE , Don R.Day, Microsoft. There is an excelent XSL-FAQ maintained by Dave Pawson. The official standard can be found at the W3CM web site. How to write a stylesheet that produces XSL?Use the XSL namespace-alias element. For example (from the XSL FAQ), <xxsl:stylesheet xmlns:xxsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="anything" version="1.0"> <xxsl:output method="xml" indent="yes"/> <xxsl:namespace-alias stylesheet-prefix="xsl" result-prefix="xxsl"/> <xxsl:template match="/"> <xsl:stylesheet version="1.0"> <xsl:template match="/"> <xsl:value-of select="foo"/> </xsl:template> </xsl:stylesheet> </xxsl:template> </xxsl:stylesheet> which in ShoXS looks like
<xxsl:stylesheet xmlns:xsl="anything"
xmlns:xxsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xxsl:output method="xml" indent="yes"/>
<xxsl:namespace-alias stylesheet-prefix="xsl"
result-prefix="xxsl"/>
match(/){
<xsl:stylesheet version="1.0">
<xsl:template match="/">
<xsl:value-of select="foo"/>
</xsl:template>
</xsl:stylesheet>
}
</xxsl:stylesheet>
and outputs <?xml version = '1.0' encoding = 'UTF-8'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:value-of select="foo"/> </xsl:template> </xsl:stylesheet> How to write a stylesheet that produces Javascript?You can wrap your Javascript in a CDATA section. Because Javascript has a lot of keywords in common with the default ShoXS, it may be worthwhile to change your ShoXS keywords in order not to confuse the processor. How to output curly braces?Because ShoXS uses curly braces to indicate blocks, a ShoXS processor can be confused by curly braces that should be in the output. For example, the ShoXS phrase if($x=1){<p>{}</p>} is hard to interpret.
This can easily be solved by placing the brace in an xsl:text command
like this: if($x=1){<p>text"{}"</p>}.
| |||||||||||||||