Hi Werner,

I'd like to generate all things "in memory". I understood, that it's possible 
to write a batch or use an ANT Task to do generation, compilation and at least 
the usage, but I would like to do that in my Java-Program. Another task is, 
that I would like to work with changing or unknown Schemas. For those i'd like 
to generate an XML instance. So, I don't know the class names and elemts at 
programming time. I wish, it would be possible to write something like:

Schema schema = new Schema(fileName);
Iterator it = schema.getComponents();
while (it.hasNext())
{
   Component c = getComponent();
   // for the component and all it's childs
   // generate xml-entry in result-file
   // e.g. if xml-type is String: 
   // check length of the string from another source
   //   write <c.getName()>abcd</c.getName()>
}

Again, I can do that with generated and compiled sources for I know the name of 
my root-element, but I'd like to integrate it in one program, that I can 
deliver to the testers. They should generate their test XMLs as simple as 
possible on their own.

Thanks for thinking about my problem and Happy Easter
uli


-----Ursprüngliche Nachricht-----
Von:    Werner Guttmann [mailto:[EMAIL PROTECTED]
Gesendet:       Do 13.04.2006 20:44
An:     [email protected]
Cc:     
Betreff:        Re: [castor-user] Generating XML from Schema
Ulrich,

Is there any particular reason why you could not use the source
generator to generate Java classes from the XML Schema instance, and use
the generated object model to create the XML instance.

Regards
Werner

Ulrich Freyer-Hirtz wrote:
> Hi,
> for testing purposes we like to generate a xml Document from a given Schema 
> and fill them with special values depending on the schema.
> With SchemaReader in could read in the Schema and here's my question:
> How to generate a xml from that object ? With Castor or manual element for 
> element ?
> How to set values and how to save in xml Format may be standard stuff of 
> Coastor..
>  
> Cheers
> uli


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------





-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to