src/main/java/org/jboss/util/xml/catalog/readers/XCatalogReader.java
public void startElement (String namespaceURI,
			    String localName,
			    String qName,
			    Attributes atts)
    throws SAXException {

    int entryType = -1;
    Vector entryArgs = new Vector();

    if (localName.equals("Base")) {
      entryType = catalog.BASE;
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Base", atts.getValue("HRef"));
    } else if (localName.equals("Delegate")) {
      entryType = catalog.DELEGATE_PUBLIC;
      entryArgs.add(atts.getValue("PublicId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Delegate",
		    PublicId.normalize(atts.getValue("PublicId")),
		    atts.getValue("HRef"));
    } else if (localName.equals("Extend")) {
      entryType = catalog.CATALOG;
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Extend", atts.getValue("HRef"));
    } else if (localName.equals("Map")) {
      entryType = catalog.PUBLIC;
      entryArgs.add(atts.getValue("PublicId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Map",
		    PublicId.normalize(atts.getValue("PublicId")),
		    atts.getValue("HRef"));
    } else if (localName.equals("Remap")) {
      entryType = catalog.SYSTEM;
      entryArgs.add(atts.getValue("SystemId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Remap",
		    atts.getValue("SystemId"),
		    atts.getValue("HRef"));
    } else if (localName.equals("XMLCatalog")) {
      // nop, start of catalog
    } else {
      // This is equivalent to an invalid catalog entry type
      catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
    }

    if (entryType >= 0) {
      try {
	CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
	catalog.addEntry(ce);
      } catch (CatalogException cex) {
	if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
	} else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", localName);
	}
      }
    }
    }
public void startElement (String namespaceURI,
			    String localName,
			    String qName,
			    Attributes atts)
    throws SAXException {

    int entryType = -1;
    Vector entryArgs = new Vector();

    if (localName.equals("Base")) {
      entryType = catalog.BASE;
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Base", atts.getValue("HRef"));
    } else if (localName.equals("Delegate")) {
      entryType = catalog.DELEGATE_PUBLIC;
      entryArgs.add(atts.getValue("PublicId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Delegate",
		    PublicId.normalize(atts.getValue("PublicId")),
		    atts.getValue("HRef"));
    } else if (localName.equals("Extend")) {
      entryType = catalog.CATALOG;
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Extend", atts.getValue("HRef"));
    } else if (localName.equals("Map")) {
      entryType = catalog.PUBLIC;
      entryArgs.add(atts.getValue("PublicId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Map",
		    PublicId.normalize(atts.getValue("PublicId")),
		    atts.getValue("HRef"));
    } else if (localName.equals("Remap")) {
      entryType = catalog.SYSTEM;
      entryArgs.add(atts.getValue("SystemId"));
      entryArgs.add(atts.getValue("HRef"));

      catalog.getCatalogManager().debug.message(4, "Remap",
		    atts.getValue("SystemId"),
		    atts.getValue("HRef"));
    } else if (localName.equals("XMLCatalog")) {
      // nop, start of catalog
    } else {
      // This is equivalent to an invalid catalog entry type
      catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
    }

    if (entryType >= 0) {
      try {
	CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
	catalog.addEntry(ce);
      } catch (CatalogException cex) {
	if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
	} else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", localName);
	}
      }
    }
    }
public void startElement ( String namespaceURI , String localName , String qName , Attributes atts ) throws SAXException { int entryType = - 1 ; Vector entryArgs = new Vector ( ) ; if ( localName . equals ( "Base" ) ) { entryType = catalog . BASE ; entryArgs . add ( atts . getValue ( "HRef" ) ) ; catalog . getCatalogManager ( ) . debug . message ( 4 , "Base" , atts . getValue ( "HRef" ) ) ; } else if ( localName . equals ( "Delegate" ) ) { entryType = catalog . DELEGATE_PUBLIC ; entryArgs . add ( atts . getValue ( "PublicId" ) ) ; entryArgs . add ( atts . getValue ( "HRef" ) ) ; catalog . getCatalogManager ( ) . debug . message ( 4 , "Delegate" , PublicId . normalize ( atts . getValue ( "PublicId" ) ) , atts . getValue ( "HRef" ) ) ; } else if ( localName . equals ( "Extend" ) ) { entryType = catalog . CATALOG ; entryArgs . add ( atts . getValue ( "HRef" ) ) ; catalog . getCatalogManager ( ) . debug . message ( 4 , "Extend" , atts . getValue ( "HRef" ) ) ; } else if ( localName . equals ( "Map" ) ) { entryType = catalog . PUBLIC ; entryArgs . add ( atts . getValue ( "PublicId" ) ) ; entryArgs . add ( atts . getValue ( "HRef" ) ) ; catalog . getCatalogManager ( ) . debug . message ( 4 , "Map" , PublicId . normalize ( atts . getValue ( "PublicId" ) ) , atts . getValue ( "HRef" ) ) ; } else if ( localName . equals ( "Remap" ) ) { entryType = catalog . SYSTEM ; entryArgs . add ( atts . getValue ( "SystemId" ) ) ; entryArgs . add ( atts . getValue ( "HRef" ) ) ; catalog . getCatalogManager ( ) . debug . message ( 4 , "Remap" , atts . getValue ( "SystemId" ) , atts . getValue ( "HRef" ) ) ; } else if ( localName . equals ( "XMLCatalog" ) ) { // nop, start of catalog } else { // This is equivalent to an invalid catalog entry type catalog . getCatalogManager ( ) . debug . message ( 1 , "Invalid catalog entry type" , localName ) ; } if ( entryType >= 0 ) { try { CatalogEntry ce = new CatalogEntry ( entryType , entryArgs ) ; catalog . addEntry ( ce ) ; } catch ( CatalogException cex ) { if ( cex . getExceptionType ( ) == CatalogException . INVALID_ENTRY_TYPE ) { catalog . getCatalogManager ( ) . debug . message ( 1 , "Invalid catalog entry type" , localName ) ; } else if ( cex . getExceptionType ( ) == CatalogException . INVALID_ENTRY ) { catalog . getCatalogManager ( ) . debug . message ( 1 , "Invalid catalog entry" , localName ) ; } } } }
The SAX <code>startElement</code> method recognizes elements
from the plain catalog format and instantiates CatalogEntry
objects for them.

@param namespaceURI The namespace name of the element.
@param localName The local name of the element.
@param qName The QName of the element.
@param atts The list of attributes on the element.

@see CatalogEntry
The SAX <code > startElement< / code > method recognizes elements from the plain catalog format and instantiates CatalogEntry objects for them .