Sign in to follow this  
dk1234

Using xsd/castor to generate out the xmls

Recommended Posts

Hi,

I just downloaded the trial version of FusionChart to do a POC. The objective is to come up with a generic chart renderer for several of our process in portfolio analytics. I searched through the forums and the available documentation but could not find something i was looking for.

What I am wondering is whether there exists any schema xsd or something, which can be used by Castor to produce java classes for data objects used in the charts. These objects (beans) can then be populated as required from the database or elsewhere considering external configuration as well. Once populated, we could simply use Castor to marshall the objects to xmls which would be more elegant and bug free than using crude string manipulation to generate them. Is there something of that sort available?

If not, I am planning to write an xsd myself for the charts, using the field names/data types specified in online documentation [Chart XML Reference]. Only problem that I am facing is that for every type of chart, the attributes are all flattened out. While writing generic xsd, it would be helpful if you could help me abstracting out common attributes to base classes and having subclasses extend them to define their additional attributes. I can do that also but compiling and sorting out hundreds of attributes in 36 chart types in 6 catagories would really be a hectic job.

This approach would surely be more maintainable than hand coding xml creation using string manipulation.

I hope I made everything as clear as I could. Please guide me if something like this exists or help me creating it. I wont mind sharing this POC with you guys so that others can also benefit from this as it would really be a nice to have thing.

Thanks for reading this though... it was a long post.

Edited by Guest

Share this post


Link to post
Share on other sites

Hi Devendra,

Thanks for your mail.

I'm afraid we do not have XSD or such automatic XML generators as of now, for various reasons. First is backward compatibility of attributes, second is case insensitive nature of attributes and so on.

Instead of creating an XSD, we would recommend creating a JSP API to build the chart and provide the attributes. We're currently working on a PHP API and would release it in a couple of weeks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this