tags:

views:

209

answers:

1

Hello,

Some time ago, I was using XmlBeans at work and had to create programmatically an xml from a schema. Back then, I compiled the schema using XmlBeans and then used some XmlBeans functionality (I cannot recall its name right now) to create a valid xml which had all the optional and required tags and attributes.

I am leaving this question here so maybe someone could help me recall how to do this... (I also remember using Axis 2 so I am beginning to think that it was probably an Axis2 functionality?)

Thanks a lot, if I remember it I will post it...

+1  A: 

I found it, it's part of the XmlSampleUtil class in org.apache.xmlbeans.impl.xsd2inst:

// for some xmldocument doc
String s = SampleXmlUtil.createSampleForType(doc.schemaType());
YuppieNetworking