1 svg

SVG (Scalable Vector Graphic) is a language to build two-dimensional graphics and graphic applications in XML. XSQL-Script is a grammar based also in the XML (Extensible Markup Language) format. It is necessary, a methode to write a SVG text in a XQSL-Script programm since if it is written directly it will be interpreted by the XSQL-Script interpreter, provoking interpretation errors.

The way to prevent that the interpret from confusing the SVG text as own code of the XSQL-Script is using a methode or own tag of the grammar which indicates to the interpret which should issue SVG text and not interpret it.

To develop this feature, a SVG tag should have the prefix svg. For example: the SVG text:

Copy
<?xml version='1.0' encoding='iso-8859-1'?>
<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'>
<rect x='10.0' y='50.0' width='80.0' height='40.0' style='stroke:none; fill:#FF8040' />
</svg>

It should be written:

Copy
<string trim='true'>
<?xml version='1.0' encoding='iso-8859-1'?>
<svg.svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'>
<svg.rect x='10.0' y='50.0' width='80.0' height='40.0' style='stroke:none; fill:\#FF8040' />
</svg.svg>
</string>

The first line should escape to prevent it from being interpreted and the coulour preceded by \ to prevent it from being interpreted as a variable to carry #. The tag string is used with the attribute trim because the line <?xml version='1.0' encoding='iso-8859-1'?> should be always go first and without espaces.