prefixes[fill] = m_schemaPrefix;
indexes[fill] = m_schemaIndex;
// build schema extracts from main component and all referenced components
String clasname = group.getGenerateClass().getFullName();
TreeWalker walker = new TreeWalker(null, new SchemaContextTracker());
boolean ref = false;
List list = refcomps.asList();
for (Iterator iter = list.iterator(); iter.hasNext();) {
// add a blank line separating components
if (ref) {
strwriter.write(COMMENT_LEAD_TEXT);
} else {
ref = true;
}
// add any necessary namespace declarations
AnnotatedBase comp = (AnnotatedBase)iter.next();
for (Iterator jter = uritoprefix.keySet().iterator(); jter.hasNext();) {
String uri = (String)jter.next();
comp.addNamespaceDeclaration((String)uritoprefix.get(uri), uri);
}
// write the documentation
DocumentationVisitor visitor = new DocumentationVisitor(comptoclas, clasname, comp, dropanno, ref,
indexes, prefixes);
walker.walkElement(comp, visitor);
strwriter.flush();
}
// convert generated schema fragment to plain text for embedding