aspose file tools*
The moose likes JSF and the fly likes XML reading issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "XML reading issues" Watch "XML reading issues" New topic
Author

XML reading issues

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238

Hi,
I was trying to create custom resource bundle using XML file instead of routine property file loading as per following link
http://www.java2s.com/Code/Java/JDK-6/XMLresourcebundle.htm
I did everything as given in the link. But I was not able to execute the program when I run it. The java program supposed to read the Strings.XML data and similar other XML files based on the arguments we pass in newBundle method. Please advise.
Any links, resources, suggestions, sample code highly appreciated. Thanks in advance.
Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
I have couple of classes


other class looks like



xml is at location
C:/xyz/abc

Please advise
Pradeep Katipamula
Ranch Hand

Joined: May 11, 2010
Posts: 37
Hi,

I didn't change your code much (only removed few lines). Below is the code


The Resources bundle reads the files through the classloader. So here i copied the xml properties file 'myresources' to the packges structure 'com.test' and updated the same in the above code, which solves the problem.

I hope this helps

If you have any other requirements just let me know.

Pradeep
Pradeep Katipamula
Ranch Hand

Joined: May 11, 2010
Posts: 37
And i am not sure why you have posted this under 'JSF'
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XML reading issues