Sample HTML page with BSL markup

<foreach name=a list="0 1 true false no spack">
  <if name=a>
    <b><get a></b>
  <else>
    <get a>
  </if>
  <br>
</foreach>

<if name=handlersd glob="t*">
  hello
  <if root> root in handler </if>
<elseif name=tem.class>
  <if root> root in tem.class </if>
  snarky
<elseif rootx>
  dkjkjqweqw
  qwejkqwhekjqeqw <pre>
<else>
  goodbye
  <boo>
  <goo>
</if>

<hr>

<foreach name=a list="x y z">
    <a href=#><get a></a>
    <ul>
    <foreach name=b list="a b c">
       <li><get a>-<get b>
    </foreach>
    </ul>
</foreach>

<hr>

All properties:


<table border>
<foreach name=a glob=*>
    <tr><td><get a.name><td><get a.value></tr>
</foreach>
</table>

<hr>

All properties matching regexp "(m.*)\.(.*)":


<table border>
    <tr>
	<th>a.name
	<th>a.name.0
	<th>a.name.1
	<th>a.name.2
	<th>a.value
    </tr>
<foreach name=a match="(m.*)\.(.*)">
    <tr>
	<td><get a.name>
	<td><get a.name.0>
	<td><get a.name.1>
	<td><get a.name.2>
	<td><get a.value>
    </tr>
</foreach>
</table>

<hr>

All properties ending with ".class", with the ".class" part stripped off:


<br>

<foreach name=a glob=*.class>
<get a.name.1>=<get a.value><br>
</foreach>

<hr>

Iterating over the values in the handlers property


<foreach name=a property=handlers>
    <li> <get a>
</foreach>
</ul>

Variable substitution

<ul>
<foreach name=id property=employees> 
   <if employee.${id}.current> <li>
       <foreach name=field list="first middle last">
         <get employee.${id}.${field}>
       </foreach>
   </if>
</foreach>
</ul>

Variable substitution with form integration


<h1>Select Properties to Display</h1>
<form>
  <table border=2>
    <caption>Enter property critereon</caption>
    <tr><td>Must Match (glob)</td><td><input name=match value=*></td></tr>
    <tr><td>Highlight values (glob)</td><td><input name=highlight></td></tr>
    <tr><td>sort by</td><td>
	    <select name=sort>
               <option>name
               <option>value
            </select>
        </td></tr>
  </table>
  <input type=submit>
</form>

<if Query:match>
  <h1>Selected Properties</h1>
  <table border>
    <caption>
      Properties matching (<b><get Query:match></b>)
      sorted by <b><get Query:sort></b>
    </caption>
    <foreach name=a glob=${Query:match} sort=${a.${Query:sort}}>
      <tr><td>
	    <get a.name>
	  </td>
          <if name=a.value glob=${Query:highlight}>
	    <td bgcolor=orange> <else> <td>
	  </if>
            <get a.value>
	  </td>
      </tr>
    </foreach>
    </table>
</if>