|XML File generation [message #1039743]
||Fri, 12 April 2013 14:28
| Julia Blon
Registered: April 2013
I would like to know if it is possible to generate a xml file out of java code which is following the rules defined in a xsd file and is filled with some values.
The background of this question is that I have an Ecore Model where I get my values from and I want to generate a configuration xml file filled with this values which is conform to the struture defined in an xsd file.
I ve heared something about Web Standard Tools but as far as I understood you can create the XML by right clicking and so on. I would like to have some sort of a method so i could trigger the generation out of my code.
Is it possible?
Thanks a lot for your help in advance
|Re: XML File generation [message #1041627 is a reply to message #1041577]
||Mon, 15 April 2013 10:40
| Ed Merks
Registered: July 2009
On 15/04/2013 11:10 AM, Julia Blon wrote:
> Well ye, you are right. It's not really a JDT question, but i didnt
> find any java-only forum. I thought since I m using and extending the
> eclipse framework, i wanted to ask my question in a forum which is the
> most related to it. I m really sorry about this mistake.
It's not a big problem, you're just less likely to get answers if your
question doesn't fit the forum topic.
> About your answer and web tools: it seems to me that it does completly
> the opposite of that, what i m trying to do.
It lets you edit XML instances that conform to a XML Schema.... That
sounds like what you're doing...
> I would like to generate an xml file having and xsd and some value
> information which is extracted from my emf model. The tutorial is
> about generationg emf model using an xml or xsd.
Well yes, that would be the idea. You'd use the model generated from
the XSD to populate the information you want saved as XML, i.e., create
instances and set their feature's values. You'd put those model
instances into a resource (an XMLResourceImpl) and you'd save that; it
would produce XML that conforms to the schema. That sounds exactly like
what you're trying to do.
Powered by FUDForum
. Page generated in 0.01857 seconds