/** * Return an <code>XSModel</code> that represents components in * the schema grammars in this pool implementation. * * @return an <code>XSModel</code> representing this schema grammar */ public XSModel toXSModel() { return toXSModel(Constants.SCHEMA_VERSION_1_0); }
public XSModel toXSModel(short schemaVersion) { ArrayList list = new ArrayList(); for (int i = 0; i < fGrammars.length; i++) { for (Entry entry = fGrammars[i] ; entry != null ; entry = entry.next) { if (entry.desc.getGrammarType().equals(XMLGrammarDescription.XML_SCHEMA)) { list.add(entry.grammar); } } } int size = list.size(); if (size == 0) { return toXSModel(new SchemaGrammar[0], schemaVersion); } SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]); return toXSModel(gs, schemaVersion); }
/** * Parses the content of XML Schema documents specified as the list of URI * references. If the URI contains a fragment identifier, the behavior * is not defined by this specification. * @param uriList The list of URI locations. * @return An XSModel representing the schema documents. */ public XSModel loadURIList(StringList uriList) { int length = uriList.getLength(); try { fGrammarPool.clear(); for (int i = 0; i < length; ++i) { fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null)); } return fGrammarPool.toXSModel(); } catch (Exception e) { fSchemaLoader.reportDOMFatalError(e); return null; } }
/** * Parses the content of XML Schema documents specified as a list of * <code>LSInput</code>s. * @param is The list of <code>LSInput</code>s from which the XML * Schema documents are to be read. * @return An XSModel representing the schema documents. */ public XSModel loadInputList(LSInputList is) { final int length = is.getLength(); try { fGrammarPool.clear(); for (int i = 0; i < length; ++i) { fSchemaLoader.loadGrammar(fSchemaLoader.dom2xmlInputSource(is.item(i))); } return fGrammarPool.toXSModel(); } catch (Exception e) { fSchemaLoader.reportDOMFatalError(e); return null; } }