示例#1
0
 private void addOneSchemaCrossImports(XmlSchema schema) {
   /*
    * We need to visit all the top-level items.
    */
   for (XmlSchemaElement element : schema.getElements().values()) {
     addElementCrossImportsElement(schema, element);
   }
   for (XmlSchemaAttribute attribute : schema.getAttributes().values()) {
     XmlSchemaUtils.addImportIfNeeded(schema, attribute.getRef().getTargetQName());
     XmlSchemaUtils.addImportIfNeeded(schema, attribute.getSchemaTypeName());
   }
   for (XmlSchemaType type : schema.getSchemaTypes().values()) {
     addCrossImportsType(schema, type);
   }
 }
示例#2
0
  private void processXmlSchema(XmlSchema schema) {
    Map<QName, XmlSchemaElement> elements = schema.getElements();
    Iterator<XmlSchemaElement> xmlSchemaElementIterator = elements.values().iterator();

    while (xmlSchemaElementIterator.hasNext()) {
      Object o = xmlSchemaElementIterator.next();
      XmlSchemaElement element = (XmlSchemaElement) o;
      XmlSchemaType schemaType = element.getSchemaType();
      if (schemaType instanceof XmlSchemaComplexType) {
        processComplexType(element);
      } else if (schemaType instanceof XmlSchemaSimpleType) {
        processSimpleType(element);
      }
    }
  }