try { if (!isURI(uri)) throw new IllegalArgumentException("illegal URI: " + uri); if (!isNCName(prefix)) throw new IllegalArgumentException("illegal NCName: " + prefix); } catch (IOException e) { XMLStreamException e2 = new XMLStreamException(e); e2.initCause(e); throw e2; }
  public void setPrefix(String prefix, String uri)    throws XMLStreamException  {    if (!namespaces.declarePrefix(prefix, uri))      throw new XMLStreamException("illegal prefix " + prefix);  }