Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » XML File generation
XML File generation [message #1039743] Fri, 12 April 2013 14:28 Go to next message
Julia Blon is currently offline Julia Blon
Messages: 3
Registered: April 2013
Junior Member
Hej,

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 #1040200 is a reply to message #1039743] Sat, 13 April 2013 06:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26126
Registered: July 2009
Senior Member
Julia,

You want something that will just generate "random" XML instances?


On 12/04/2013 5:12 PM, Julia Blon wrote:
> Hej,
>
> 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 #1041493 is a reply to message #1040200] Mon, 15 April 2013 07:07 Go to previous messageGo to next message
Julia Blon is currently offline Julia Blon
Messages: 3
Registered: April 2013
Junior Member
What do u mean with random? I ve the allowed structure of the document, saved in the xsd file and i have couple of values which i set depending on the user input.
Re: XML File generation [message #1041563 is a reply to message #1041493] Mon, 15 April 2013 08:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26126
Registered: July 2009
Senior Member
Julia,

Comments below.

On 15/04/2013 9:07 AM, Julia Blon wrote:
> What do u mean with random?
Well, you weren't exactly clear where there values were coming from, so
from "this air" might be one reasonable assumption.
> I ve the allowed structure of the document, saved in the xsd file and
> i have couple of values which i set depending on the user input.

Maybe you want to try this tutorial.

http://www.eclipse.org/modeling/emf/docs/2.x/tutorials/xlibmod/xlibmod_emf2.0.html

The Web Tools project also has a nice structured XML Schema-aware editor...

Nothing in your questions seem remotely related to JDT...
Re: XML File generation [message #1041577 is a reply to message #1041563] Mon, 15 April 2013 09:10 Go to previous messageGo to next message
Julia Blon is currently offline Julia Blon
Messages: 3
Registered: April 2013
Junior Member
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.

About your answer and web tools: it seems to me that it does completly the opposite of that, what i m trying to do. 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.
Re: XML File generation [message #1041627 is a reply to message #1041577] Mon, 15 April 2013 10:40 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26126
Registered: July 2009
Senior Member
Julia,

Comments below.

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.
Previous Topic:F3 opens the classB.class file instead of the classB.java file
Next Topic:Java Package Explorer Oddity
Goto Forum:
  


Current Time: Tue Oct 21 00:39:06 GMT 2014

Powered by FUDForum. Page generated in 0.01857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software