|
The xml looks fine, can you include the
errors?
----- Original Message -----
Sent: Monday, October 10, 2005 12:43
AM
Subject: [castor-user] Generating XML
using Castor
Hi,
I had generated an XML using Castor, but had errors.
Any ideas of correcting this ,pl let me know.
The output XML is enclosed.
The code for generation of XML is:
public String createXML(Object object)
throws
IOException, MarshalException, ValidationException,
MappingException {
String xmlFileName =
"Specification-Template.xml";
Mapping mapping = new Mapping();
mapping.loadMapping("mapping-castor.xml");
File f = new File(xmlFileName
);
FileWriter fileWriter = new FileWriter(f);
Marshaller m = new Marshaller(fileWriter);
m.setMapping(mapping);
m.setDebug( true);
m.setSuppressXSIType( true);
m.marshal((SpecificationVO) object);
fileWriter.close();
File xmlFile = new File(xmlFileName);
return
xmlFile.getAbsolutePath();
}
Any ideas ,pl let me know.
Thanks
Gopi
------------------------------------------------- If you wish to
unsubscribe from this list, please send an empty message to the following
address:
[EMAIL PROTECTED] -------------------------------------------------
|