Introduction: XMLTranslator is a simple program that allows to translate your 'home made' information files into the XML format. XMLTranslator as been developed in JAVA and so is Linux and MS Windows ready. Why should I use it? It is an advantage to have the possibility to translate his own information file into XML. On the first hand, XML represents a standard to store information and XML files are interpretable by most of browsers. On the other hand, there are tools called XML parsers that allow you to read in a very easy way, the content of an XML file. Parsers are plugable in most of web oriented languages (such as Php, ASP, java) and so, dynamic HTML generation based on XML files information is easy and quick to build. Functionality and How-To: The XMLTranslator program will convert your information file into XML. For this, you need to define tags into you information file which are going to be interpreted by the program. WARNING: Every tag should be between delimiters but you are completely free to define your own delimiters (see example below) XMLTranslator should be compiled with a java compiler. Simple type 'javac XMLTranslator.java' and youn will generate the bytecode automatically because all classes are included in one file. (A pre-compiled version will come soon). Execution of the bytecode should be done with your standard java VM (Virtual Machine). The program need either 2 or 3 arguments. Use it as: java XMLTranslator <file_name1> <file_name2> <ctrl_file> or: java XMLTranslator <file_name1> <ctrl_file> where : <file_name1> is the name of your own information file <file_name2> is the name that the generated XML file should have (something lik 'file.xml') <ctrl_file> is the name of a control file Note: if you don't specify the <file_name2> argument, the program autogenerate an XML file which name is <file_name1>.xml Control file: The control file will guide the program during the process, so it will be able to generate the appropriate XML. Inside the control file, you should tell the translator which 'home defined tags' he is going to encounter and how to handle them. You can also take the decision to let the program generate the XML automatically. Note: in XML format, it is important to know if what is between 2 tags will contain others tags (root tag) or if what is between 2 tags will be end information and so won't contain other tags (leaf tag). The control (ctl) file should contain (2 examples follow): number of tags=[X] xml tags defined=[y]/[n] list: [HM tag1] <xml tagO1> <xml tagC1> 0/1 [HM tag2] <xml tagO2> <xml tagC2> 0/1 ... The 'number of tags'field define the total number of differents tags in the information file (should be an integer). The 'xml tags defined field' is here to tell the program if it should autmatically generate the XML tags or if they are defined (if you tell the programm to generate tags BUT you misstake and define tags, the program won't take care of your XML tags). The value should be 'y' (for 'yes', it's defined ;-) or 'n' for 'no'. The list field will contain the list of information. Every information line should be ended by 0 or 1 to tell the programm if tha tag is a root or a leaf (0 for root and 1 for leaf). Example 1: number of tags=2 xml tags defined=y list: [NNNN] <news> </news> 0 [H] <H> </H> 1 --In this example '[' and ']' are considered as delimiters, the home made information file contains the [NNNN] and the [H] tag, which are going to be replaced in XML by the defined tags. [NNNN] is a root, [H] is a leaf. Example 2: number of tags=2 xml tags defined=n list: [NNNN] 0 [H] 1 --In this example '[' and ']' are considered as delimiters, the home made information file contains the [NNNN] and the [H] tag, which are going to be replaced in XML automatically by <NNNN></NNNN> and <H> </H>. [NNNN] is a root, [H] is a leaf. IMPORTANT PART: Respect the case because the control is case sensitive. TODO: the program has not been fully tested. For any technical question please contact the administrator of the project: sly@users.sourceforge.net