This section shows the procedure to follow to integrate the HTML code in xsqlscript.

To obtain more information about the HTML language you can access to the page : HTML documentation.

To be able to integrate the HTML code, does not work to write directly the tags you want, this is because the XSQL language itself is already encode in tags; so when a label is written literally, XSQL tries to interpret it as a tag.

1 Ejemplo XSQL

The following example is an script XSQL which shows by the standard exit the string "Hello world!" :

Copy
<xsql-script name='main'>
     <body>
           <println>Hello world!</println>
      </body>
</xsql-script>

2 Ejemplo HTML

This other code in HTML generates a page with the string "Hello world" :

Copy
<html>
     <body>
          <p>Hello world!</p>
     </body>
</html>

3 Ejemplo incorrecto

Seeing the last two examples, if you want to obtain a XSQL script that generates a HTML file, you can wrongly conclude to write the following code:

Copy
This code is wrong

<xsql-script name='main'>
    <body>
        <println>
           <html>
              <body>
                 <p>Hello world!</p>
              </body>
           </html>
        </println>
    </body>
</xsql-script>

This code is wrong

The result to execute the script is obvius: syntaxis fail

The tags <body> despite writing the same do not intend to code the same, one defines the body of the script and the other will define the body of the HTML document to generate; but for the scripts interpreter, both are equals and it induces it to fail.

4 Ejemplo correcto

The correct encoding for the previous example would be the sollowing:

Copy
<xsql-script name='main'>
    <body>
        <println>
           <html.html>
              <html.body>
                 <html.p>Hello world!</html.p>
              </html.body>
           </html.html>
        </println>
    </body>
</xsql-script>

5 Execution via command line

It is necessary to use this special tags which will be interpret for the script interpreter and replaced by the corresponding strings at the time to writte the exit.

Notas

This labels can bring the attributes taht usually need in HTML, for example the style attributes.

Some examples of html labels:

Copy
<html.table>
<html.tr>
<html.td>
<html.th>
<html.bodyble> 
<html.html>
<html.head>