Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » XSD » Serialize XSD Object(Serialize XSD Object having <xs:include> tags )
Serialize XSD Object [message #764953] Tue, 13 December 2011 06:51
Manu  is currently offline Manu
Messages: 7
Registered: November 2009
Junior Member
I have a object of org.eclipse.xsd.impl.XSDSchemaImpl class of a xsd schema [say A.xsd]. This schema has some <xs:include> tags for including other supporting schemas [say B.xsd and C.xsd]. Now I want to convert this XSDSchemaImpl object into a String such that it include all the element definitions which are defined in the supporting included schema [i.e in B.xsd and C.xsd] will be part of this string. I tried it this way but it gives me only A.xsd in the String.
public Writer writeSchema(XSDSchema schema) throws IOException {
    if (schema == null){
        return;
    }
    URI schemaUri = URI.createFileURI("");
    Resource resource = new XSDResourceFactoryImpl().createResource(schemaUri);
    resource.getContents().add(schema);
    XSDResourceImpl xsdResource = (XSDResourceImpl) resource;
            Writer strWriter = new StringWriter();
    try {
        xsdResource.save(writer, null);
    } finally {
        xsdResource.unload();
    }
            return strWriter ;
}
.

I posted the same message here too. As I am not sure which is the correct forum for this. http: //www.eclipse.org/forums/index.php /m/764951/#msg_764951
Previous Topic:Code Generation with Acceleo (Autosar XSD -> C Code)
Next Topic:Load EMF from xml stream
Goto Forum:
  


Current Time: Fri Oct 24 14:53:33 GMT 2014

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

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