Using XML as config file

Discussion in 'Bukkit Help' started by Rayfe, Oct 7, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Rayfe

    This may not be the place to ask about this and if it is I will be glad to move to the related area. And this is more of a how-to question so I don't believe my system/version information has any relevance here.

    I'm new to Java but I have a vague understanding of OOP as I've been looking in to Obj-C for a while now. I'm attempting what I believe to be a fairly simple Bukkit plugin. The Java will contain several string arrays that I would like to be configurable. There is no reason to communicate back to the config file from Java.. The plugin only needs to import the config parameters once it's enabled.

    These parameters will simply be keywords that are placed into these arrays. Because of this specific functionality I thought that an XML config file would best suit my needs. That way its pretty understandable to the user to set the parameters.

    Code:
    <keywords>
    	<topic id="topic1">
    		<word1>firstword</word1>
    		<word2>secondword</word2>
    		<word3>thirdword</word3>
    	</topic>
    	<topic id="topic2">
    		<word1>firstword</word1>
    		<word2>secondword</word2>
    		<word3>thirdword</word3>
    	</topic>
    </keywords>
    I have searched all over for specific tutorials regarding importing XML data into Java and it seems there are several options, but really I'm not sure which way I should use or what would work with how Bukkit plugins work.

    I was following along with betterphp's config files tutorial but he looses me once he begins to make things specific to yml format.

    Any help or information that would assist me would be appreciated. And I can supply more specifics if needed, but the bottom line is I want to XML data into Java arrays. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page