com.ibm.xml.parser
Interface NoRequiredAttributeHandler
- public abstract 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:
- Revision: 81 1.4 src/com/ibm/xml/parser/NoRequiredAttributeHandler.java, parser, xml4j2, xml4j2_0_15
- See Also:
Parser.addNoRequiredAttributeHandler(com.ibm.xml.parser.NoRequiredAttributeHandler)
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. |
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:
Parser.addNoRequiredAttributeHandler(com.ibm.xml.parser.NoRequiredAttributeHandler)
,
AttDef
,
Attlist
,
TXAttribute
,
TXAttributeList
,
Namespace