|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Configuration files
Peter Murray-Rust wrote: > >Better here, I think, to use the simple keyword=value format > >defined by java: > > > >parser.AElfred=com.microstar.xml.SAXDriver > >parser.xp=com.jclark.xml.sax.Driver > >preferred.parser=xp > > If this is already parsed by Java I am happy to use it. But for structured > things like menus we definitely want XML. Yes, Java already parses property files in this format. Structured items are a bit more trouble, and somewhat inflexible. But we use something like this: myapplet.menu.file=File myapplet.menu.file.open=Open myapplet.menu.file.save=Save myapplet.menu.file.close=Close This example is how we handle internationalization. Simple change the values on the RHS to whatever label you want to appear on the item. For this application I would tend to favor the idea of using a property file for the bare-bones bootstrapping, perhaps using an entry to point to a more thorough config file in XML. This way one can take advantage of the way the Java class loader can "hunt down" the properties file in a nice, platform independent way. Incidentally, the property files can also be placed in packages by placing the file in the appropriate directory and prepending the package name when retrieving it. Note that there is no "package" keyword that must be placed in the file, nor must the filename itself be changed. So to have a property file com.mycompany.myclasses.myapplet I would create a file called myapplet.properties and place it in the directory com/mycompany/myclasses. Then when I requested the ResourceBundle called com.mycompany.myclasses.myapplet it would automatically be located, just like one of the class files making up my applet. Eddie xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








