Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrXML
storing data of unknown type...configurable xml files

Brandon
Guest
Quote
2010-09-22 20:23:35

I currently working on a data management project in which I want the end user to be able to setup a database. Specifying categories, elements in each category, and properties/attributes of each element. It needs to be configurable so that at any time they can change what data is stored for each element. For instance. Lets say the database is for asset management. They might need categories for Stocks, bonds, Savings accounts, and property. Stocks would need to know they company name, current stock price, etc. Property would need a name/label for the property, address, buying price, current market value, etc.

At some point the user might need additional information for lets say properties, such as the date purchased. I need to be able to enable the user to edit (via a gui, not xml) the database info at anytime and make changes as needed. The Interface part is handled. My question is how to acquire and store information in an xml file in memory when me, as the coder, dont know what type of information can be entered.

I have thought about having irrxml parse config.xml for instance. The config file is read and each element being a category name, then each sub element (or attribute) in each category would be a property of that category. like...

<root>
<Stocks stockName="" stockPrice="" />
<Propertys propName="" propPurchaseDate="" propBuyValue="" />
.
.
.
</root>

then I would need an xml file for each category

<!--stocks information -->
<root>
<stock1 stockName = "Dow Jones" stockPrice = "55.10" />
<stock2 stockName = "Disney" stockPrice = "34.15" />
</root>

and so on. What my concern is that the readers "read" function changes the values in the reader Node to whatever the next node is, so how can I go about creating a database in memory to know what categories there are without knowing the categories and other information at compile time? Additionally, is there a node structure or class that I can use in a vector array or something that would allow me to parse the file, store the current node info in some local structure, then add it to the array? Keep in mind, that one user might need 5 categories and have a variable amount of information in each category but another user might only need 2 categories and less information (or more) for each.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact