Benson Margulies wrote:

Dan,

 

I’d look at this today if you can give me any sort of running start about where they go and what they look like.

 

--benson

 

Hi Benson,

The place I think you want to focus on is AegisDatabinding.createSchemas. Thats where we create the schema element:

Element e = new Element("schema", xsdPrefix, XmlConstants.XSD);

There is a Set<Type> objects which are in that schema namespace. You should theoretically be able to loop through their dependencies and add namespaces:

for (Type schemaType : entry.getValue()) {
  for (Type importedType : schemaType.getDependencies()) {
   String ns = importedType.getSchemaType().getNamespaceURI();
   if (ns != XSD_NS && ns != entry.getKey() && importHasNotAlreadyBeenAdded) {
     Element importEl = new Element("import", xsdPrefix, XmlConstants.XSD);
     importEl.setAttribute(new Attribute("namespace", ns);
     e.addContent(importEl);
   }
}

Hope that helps,

- Dan
-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog


Reply via email to