XML-Based Programming Systems

by Gregory V. Wilson





Figure 1:

<HTML>

<BODY>

<TABLE BORDER=2>

<%

  for (int i = 0; i<n; i++) {

%>

    <TR>

    <TD>Number</TD>

    <TD><%= i+1 %></TD>

    </TR>

<%

  }

%>

</TABLE>

</BODY>

</HTML>



Figure 2:

<project name="ddj" default="all" basedir=".">



  <property name="src" value="." />

  <property name="build" value="/tmp/ddj" />



  <target name="init">

    <mkdir dir="${build}" />

  </target>



  <target name="compile" depends="init" > 

    <javac srcdir="${src}" destdir="${build}" />

  </target>



</project>





Figure 3:

/**

 * This class prints <em>odd</em> numbers.

 * See the <a href="copyright.html">copyright</a>.

 * @author Greg Wilson

 * @version 1.2

 */





public class Odds {

  public static void main(String[] args) {

    for (int i=0; i<10; ++i) {

      if (i % 2) {

        System.out.println(i);

      }

    }

  }

}







Figure 4:

<doc>

<p>This class prints <em>odd</em> numbers.

See the <a href="copyright.html">copyright</a>.</p>

<author>Greg Wilson</author>

<version>1.2</version>

</doc>

<code>

public class Odds {

  public static void main(String[] args) {

    for (int i=0; i &lt; 10; ++i) {

      if (i % 2) {

        System.out.println(i);

      }

    }

  }

}

</code>





Figure 5:

This class prints odd numbers.  See the copyright.



Author: Greg Wilson


Version 1.2

public class Odds {
   public static void main(String[] args) {

     for (int i=0; i < 10; ++i) {

       if (i % 2) {

          System.out.println(i);

       }

     }

   }

}





Figure 6: 



<class name="XTerm">

   <scope type="public">

      <func type="int" name="GetSize">

         <body>

            <return>-1</return>

         </body>

      </func>

   </scope>

</class>



<node name="MyObj" class="XTerm" />

<xout>Class is </xout>

<xout><eval object="MyObj" attribute="class"/></xout>













