@Override public void process(@Nonnull final XmlParser xmlParser, @Nonnull final Attributes attributes) throws Exception { packageString = attributes.get("package"); if (packageString == null) { throw new Exception("[package] attribute is a required attribute"); } root = attributes.get("root"); if (root == null) { throw new Exception("[root] attribute is a required attribute"); } type = attributes.get("type"); if (type == null) { throw new Exception("[type] attribute is a required attribute"); } xmlParser.nextTag(); xmlParser.zeroOrMore( new de.lessvoid.xml.xpp3.SubstitutionGroup() .add("include", new IncludeProcessor(parserFactory, resourceLoader, types)) .add("type", new TypeProcessor(this))); }
@Override public void process(@Nonnull final XmlParser xmlParser, @Nonnull final Attributes attributes) throws Exception { String name = getNameAttribute(attributes); Type type = new Type(name, getExtendsAttribute(attributes)); niftyXmlSchema.addType(name, type); SubstitutionGroup substGroup = new SubstitutionGroup(); substGroup.add("element", new TypeProcessorElement(type)); substGroup.add("group", new TypeProcessorSubstitutionGroup(type)); xmlParser.nextTag(); xmlParser.zeroOrMore(substGroup); }