Automatically adds quotes to UI xml attribute values to improve syntax highlighting.
Audience
This program is intended for Neverwinter Nights 2 custom UI developers & UI modders.
Detailed Description
Neverwinter Nights 2 uses xml files to define much of the user interface (e.g. the character sheet). Unfortunately the in game xml parser is very permissive, which has lead to the majority of the UI code being un-parsable by third party programs. This program fills the gap by tidying up xmls files.
Firstly this means the UI xml files will highlight properly in a text editor that knows how to syntax highlight xml. If you do any UI editing this is reason enough to use this program.
Secondly it means you could use an xml viewer, or write a program that manipulates the xml. In other words it is a step in the right direction toward a graphical NWN2 UI editor.
Well Formed Vs Valid NWN2 UI
This program supports two kinds of output: valid NWN2 UI and; well formed xml.
It is not possible for a file to be both a well formed xml document (properly parsable) and work in game. The reason is that the in game parser does not accept xml files with a proper document root. Even so, using this program to tidy up the default xml will improve syntax highlighting in a text editor such as ConTEXT.
It is anticipated that most users of this program will just want tidier valid NWN2 UI xml code, for improved syntax highlighting. It can be used to do just that, no problem.
However, if you have a need to produce well formed xml, you can do so, and then convert that code back to a valid NWN2 UI when you are done manipulating it. Furthermore you are free to use the source code provided in your own programs!
Installation
Unzip to any location.
Useage
To convert your first UI file:
* From the menu bar select File->Open * Navigate to the .xml file you want to convert. By default these can be found in C:\Program Files\Atari\Neverwinter Nights 2\UI\default
* From the menu bar select Transform->Transform XML - NWN2 Style * From the menu bar select File-Save As * Save the file in your custom UI folder. By default that is in My Documents\Neverwinter Nights 2\UI\custom
* You can now view the modified xml in your favorite text viewer.
To convert to well formed xml, select Transform->Transform XML - V 1.0 compliant.
Editor I recommend ConTEXT as an editor for UI development as it syntax highlights well and closes the file handles so you can keep a scene open for editing while testing in game.
Changelog
V 1.02 - Added batch processing for transforming many files at once.
V 1.01 - Handles encodings other than utf-8; remembers the open file directory
V 1.00 - Initial release
I have not had much time for NwN2 lately and I am starting uni studies this year. At this point I don't think I will be doing any further updates to my NwN2 Vault submissions. Thank you all for the suggestions and support you have given.
I have extended this to handle multiple files at once (batch transform). I have also made available the 1.10.1116 default UIs, already transformed and with a few minor fixes.
I am moving on to other projects and will no longer be making updates here. Thanks to all of you who have supported these projects with testing and feedback. Should anyone wish to take over one or more of my projects, contact charlievale at gmail dot com and I will have the project transfered to your vault account.
Posted by mlmarkland at 2007-05-31 01:47:32 Voted 9.00 on 05/31/07
Very useful, Charlie.
Posted by Barry_The_Hatchet at 2007-03-19 01:38:35 Voted 9.00 on 03/19/07
Excellent work. This is definately a step in the right direction. Any resource that helps custom UI developers with NWN2's version of "XML" is worthwhile.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone