Adding tags
Adding new tags is a four steps process:
- Modify the DTD defined in travel.dtd and validate an XML against it to check that its correctness. You can use a service like the STG XML Validation Form.
- Extend the appropriate object (Travel, Day, Place, Content), or define a new one, with an attribute that stores the value of the tag. Create a setter and getter method for the attribute. Create a unit test to check the correctness of the implementation (the default unit tests are included in the journeysat-dev distribution). Update the toString method of JourneySat.Travel to make it output the new tag.
- Add a new method in xmlparser.js to read the value of the tag and call it from the parse method of JourneySat.Loader. Create a unit test to check that the tag is actually read and the value set in the data structure.
- Modify an existing skin to use the value, or create a totally new skin.
Changing the XML parser
The XML parser is containes in the parse method of JourneySat.Loader and it uses also the classes defined in the xmlparser.js file. A new implementation of the parser must preserve the interface of the parse method or it will break the skins.
The JourneySat.ResourceBundle class uses its own parser to read the translation XML files.
The technical documentation
This is the detailed documentation of the Javascript classes that are at the core of JourneySat.