Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java
PREV | NEXT | SHOW LISTS | HIDE LISTS |

# Interface com.ibm.xml.parser.NoRequiredAttributeHandler

public interface NoRequiredAttributeHandler

An interface for handling "no required attribute" events that are recognized by the XML4J parser. A "no required attribute" event occurs when an Element is parsed and a required Attribute for this Element is not seen; Attributes are declared as required as part of the internal and/or external DTD declaration of the XML document.

By default, the XML4J parser will record the missing attribute as part of its error reporting, and continue. This interface permits applications to define a default value when none is provided by the DTD.

For example, an application program may want to default the value of the `driver` attribute on an XML DB query specification Element to utilize the locally installed JDBC driver. In this case, the application is registered with the XML4J parser instance, prior to parsing the input stream, by using the `addNoRequiredAttributeHandler` method. Subsequently, the implemented `handleNoRequiredAttribute` method will be invoked by the XML4J parser instance when the input stream is read; the implemented `handleNoRequiredAttribute` method is responsible for manipulating the child objects of the passed element.

Version:
  1.1
See Also:
  addNoRequiredAttributeHandler

Method Summary
TXElement | handleNoRequiredAttribute(TXElement element, java.lang.String attributeName) Interface to be implemented for receiving control when a "no required attribute" event is recognized by the XML4J parser.

Method Detail

### handleNoRequiredAttribute

    public TXElement handleNoRequiredAttribute(TXElement element,
                                               java.lang.String attributeName)

  Interface to be implemented for receiving control when a "no required attribute" event is recognized by the XML4J parser. A "no required attribute" event occurs when an Element is parsed and a required Attribute for this Element is not seen; Attributes are declared as required as part of the internal and/or external DTD declaration of the XML document. Control is transferred prior to parsing any children of the Element that is missing the required attribute.
  Parameters:
    `element` - The Element Node missing the required attribute.
    `attributeName` - The name of the missing `#REQUIRED` attribute. Note that namespace names may also be included in Attribute names.
  Returns:
    The modified element, or null if the Element is to be removed from the document.
  See Also:
    addNoRequiredAttributeHandler, AttDef, Attlist, AttributeDefinition, TXAttribute, TXAttributeList, Namespace

Contents | Package | Class | Tree | Deprecated | Index | Help |
PREV | NEXT | SHOW LISTS | HIDE LISTS |