Creating java properties file from XML

The Properties class available in the package "java.util" can be used to create properties object and then load the properties from the XML file into that object. Before you load the properties defined in the XML element into the Properties object you have to create a FileInputStream object which can hold the XML file you are going to use.

_______________________________________________


_______________________________________________

The import statements that are needed to work with this properties class might include,

import java.util.*;
import java.io.*;

Using the properties object's loadFromXML() method you can load the FileInputStream object into it and use the list() method to list down the properties if needed. To get the value of a particular property you can also use the getProperty() method. Once you get this you can store in your java program to manipulate it anyway.

Lot of samples are available in the internet for using this Properties class. Check out the URL

http://www.ibm.com/developerworks/java/library/j-tiger02254.html for some.

Vale Java? Scala Vala palava - and Go too
Dave Megginson (who drove the development of the SAX API that will be familiar to many XML developers who use Java) recently wrote Java is dead. Java stood out as a programming language (though not as a platform) in that...

WSO2 Launches Newest Versions of WSO2 Business Process Server, WSO2 Data Services Server, WSO2 BAM, WSO2 Gadget Server ...
MOUNTAIN VIEW, Calif.----WSO2 today announced the availability of WSO2 Business Process Server 2.0, WSO2 Data Services Server 2.5, WSO2 Business Activity Monitor 1.1, WSO2 Gadget Server 1.1, and WSO2 Mashup Server 2.1.



FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________

Recommended XML Books

cover
cover
cover
cover
cover
cover






 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!


New XML Books Titles - Best Seller's @ Amazon.com

Visit XML Training Material Guide Homepage

Technology helps engage students - how do classroom instruction and social dynamics change when the classroom is completely dependant on modern technology?