Ini To Dom Transformer
(c) 2004 - by www.scriptol.com
Licence: OSS - Freeware open-source
Requires:
- solc, the scriptol to C++ compiler (http://www.scriptol.com/download.php).
Goal:
Loads a ini file into a dom tree.
Generates a pure xml file or a light xml source
for the Scriptol compiler.
Similar to ini2xml but requires the scriptol to C++ compiler
and may be used by a program to fill a dom tree.
Another difference is the handling of not active options.
Syntax:
ini2dom [-light] sourcefile [targetfile]
- sourcefile is a configuration file.
- targetfile will be an xml document.
Option
-light for a light xml Scriptol source.
-expand for an expanded xml file.
The initial configuration file has a format as:
[title]
name1=value1
name2=value2 ; comment
;name3=value3
; some comment
etc......
The standard output is:
The expanded output is:
In light xml, the output is:
xml
title name = "title"
option name="name1" value="value1" active="true" /
option name="name2" value="value2" active="true comment="comment" /
option name="name3" value="value3" active="false" /
comment data="some comment" /
/xml
The short format may hold invalid xml tags from option names, and
this is not a problem while the file is only processed by the
scriptol dom tree. But if an xml file is generated, external parsers
may refuse them. The expand option is implemented for that.
A blank line is rewritten as:
The default extension is ".xml" or ".sol",
it is automatically added to the node of the source filename
if no target filename specified.
Active/Not active options
The lines below are not active options, ignored by the interpreter:
#name=value
;name=value
this code is generated: