/** * Returns the declarations of all elements that are substitutable for a given element name. * * @param elementName * qualified name of the element, must not be <code>null</code> * @param namespace * only element declarations in this namespace are returned, set to <code>null</code> for all namespaces * @param transitive * if true, also substitutions for substitutions (and so one) are included * @param onlyConcrete * if true, only concrete (non-abstract) declarations are returned * @return the declarations of all substitution elements in the requested namespace */ public List<XSElementDeclaration> getSubstitutions( QName elementName, String namespace, boolean transitive, boolean onlyConcrete ) { XSElementDeclaration elementDecl = nameToElDecl.get( elementName ); if ( elementDecl == null ) { String msg = "The schema does not declare a top-level element with name '" + elementName + "'."; throw new IllegalArgumentException( msg ); } return getSubstitutions( elementDecl, namespace, transitive, onlyConcrete ); }