These elements provide common run-time functionality, and can be included in any markup system extended from spiralcraft.textgen without using a namespace prefix.
Output the result on the expression
<%=x+y*z/%>
Activate a group of elements when the condition is true
<%If x='condition'%> ... <%/If%>
Activate an alternate group of elements when the condition is false
<%If x='condition'%> ... <%Else/%> ... <%/If%>
Make the value returned by the expression the subject of the local Focus for child elements.
<%With x='somePerson'%> <%=.firstName/%> <%=.lastName/%> <%/With%>
Iterate through a collection or array
<%Iterate x='somePersonCollection'%> <%=[Iterate] index/%>: <%=.name/%>, <%=.value/%><br/> <%/Iterate%>
Output a header and/or footer when the value of an expression changes
Format a date
<%DateFormat x="someDate" format="yyyy-MM-dd" timeZone="someTimeZone"/%>
Create a single object shared by all threads and visible to child elements
<%SharedReference typeX="[@mytypes:MyWidget]" instanceURI="myWidgetConfig"/%>
...
<%=[mytypes:MyWidget] myProperty/%>
...
<%/SharedReference%>
Create an object scoped to the state tree (ie. the session model) and visible to child elements
<%LocalReference typeX="[@mytypes:MyWidget]" instanceURI="myWidgetConfig"/%>
...
<%=[mytypes:MyWidget] myProperty/%>
...
<%/LocalReference%>
These elements manipulate markup resources and the page compilation process itself
Include a resource, possibly using it as a wrapper
<%@include resource="../myfile.textgen"/%>
<%@include resource="../wrapper.textgen"%> This goes inside the wrapper where the wrapper puts @insert <%/@include%>
Insert a predefined content block
This is a wrapper around the content <%@insert/%> inside the @include that included me
Here is some predefined content <%@insert name="myPredefinedBlock"/%>
Define a content block to be activated and/or bound in a different context
<%@include resource="myTemplate"%>
<%@define name="mySpecificContent"%>
This is customized and will go into the template and be rendered as a closure
<%=myCustomExpression/%>
<%mytags:MyTag/%>
<%@/define%>
<%/@include%>
Define a namespace prefix for use in tag names and spiralcraft.lang Expressions
<%@namespace mytypes="class:/mypackage/mytypes/"%> <%mytypes:MyElement x="[mytypes:MyType] someProperty"/> <%/@namespace%>
Suppress activation of a content block
<%@comment%>Don't activate this<%/@comment%>