org.apache.xerces.xni

Interface XMLDTDContentModelHandler

public interface XMLDTDContentModelHandler

The DTD content model handler interface defines callback methods to report information items in DTD content models of an element declaration. Parser components interested in DTD content model information implement this interface and are registered as the DTD content model handler on the DTD content model source.

Version: $Id: XMLDTDContentModelHandler.java,v 1.6 2004/02/24 23:15:54 mrglavas Exp $

Author: Andy Clark, IBM

See Also:

Field Summary
static shortOCCURS_ONE_OR_MORE
This occurrence count limits the element, choice, or sequence in a children content model to one or more.
static shortOCCURS_ZERO_OR_MORE
This occurrence count limits the element, choice, or sequence in a children content model to zero or more.
static shortOCCURS_ZERO_OR_ONE
This occurrence count limits the element, choice, or sequence in a children content model to zero or one.
static shortSEPARATOR_CHOICE
A choice separator for children and mixed content models.
static shortSEPARATOR_SEQUENCE
A sequence separator for children content models.
Method Summary
voidany(Augmentations augmentations)
A content model of ANY.
voidelement(String elementName, Augmentations augmentations)
A referenced element in a mixed or children content model.
voidempty(Augmentations augmentations)
A content model of EMPTY.
voidendContentModel(Augmentations augmentations)
The end of a content model.
voidendGroup(Augmentations augmentations)
The end of a group for mixed or children content models.
XMLDTDContentModelSourcegetDTDContentModelSource()
voidoccurrence(short occurrence, Augmentations augmentations)
The occurrence count for a child in a children content model or for the mixed content model group.
voidpcdata(Augmentations augmentations)
The appearance of "#PCDATA" within a group signifying a mixed content model.
voidseparator(short separator, Augmentations augmentations)
The separator between choices or sequences of a mixed or children content model.
voidsetDTDContentModelSource(XMLDTDContentModelSource source)
voidstartContentModel(String elementName, Augmentations augmentations)
The start of a content model.
voidstartGroup(Augmentations augmentations)
A start of either a mixed or children content model.

Field Detail

OCCURS_ONE_OR_MORE

public static final short OCCURS_ONE_OR_MORE
This occurrence count limits the element, choice, or sequence in a children content model to one or more. In other words, the child may appear an arbitrary number of times, but must appear at least once.

For example:

 <!ELEMENT elem (foo+)>
 

See Also: OCCURS_ZERO_OR_ONE OCCURS_ZERO_OR_MORE

OCCURS_ZERO_OR_MORE

public static final short OCCURS_ZERO_OR_MORE
This occurrence count limits the element, choice, or sequence in a children content model to zero or more. In other words, the child may appear an arbitrary number of times, or not at all. This occurrence count is also used for mixed content models.

For example:

 <!ELEMENT elem (foo*)>
 <!ELEMENT elem (#PCDATA|foo|bar)*>
 

See Also: OCCURS_ZERO_OR_ONE OCCURS_ONE_OR_MORE

OCCURS_ZERO_OR_ONE

public static final short OCCURS_ZERO_OR_ONE
This occurrence count limits the element, choice, or sequence in a children content model to zero or one. In other words, the child is optional.

For example:

 <!ELEMENT elem (foo?)>
 

See Also: OCCURS_ZERO_OR_MORE OCCURS_ONE_OR_MORE

SEPARATOR_CHOICE

public static final short SEPARATOR_CHOICE
A choice separator for children and mixed content models. This separator is used to specify that the allowed child is one of a collection.

For example:

 <!ELEMENT elem (foo|bar)>
 <!ELEMENT elem (foo|bar+)>
 <!ELEMENT elem (foo|bar|baz)>
 <!ELEMENT elem (#PCDATA|foo|bar)*>
 

See Also: SEPARATOR_SEQUENCE

SEPARATOR_SEQUENCE

public static final short SEPARATOR_SEQUENCE
A sequence separator for children content models. This separator is used to specify that the allowed children must follow in the specified sequence.

 <!ELEMENT elem (foo,bar)>
 <!ELEMENT elem (foo,bar*)>
 <!ELEMENT elem (foo,bar,baz)>
 

See Also: SEPARATOR_CHOICE

Method Detail

any

public void any(Augmentations augmentations)
A content model of ANY.

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: XMLDTDContentModelHandler XMLDTDContentModelHandler

element

public void element(String elementName, Augmentations augmentations)
A referenced element in a mixed or children content model.

Parameters: elementName The name of the referenced element. augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

empty

public void empty(Augmentations augmentations)
A content model of EMPTY.

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: XMLDTDContentModelHandler XMLDTDContentModelHandler

endContentModel

public void endContentModel(Augmentations augmentations)
The end of a content model.

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

endGroup

public void endGroup(Augmentations augmentations)
The end of a group for mixed or children content models.

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

getDTDContentModelSource

public XMLDTDContentModelSource getDTDContentModelSource()

occurrence

public void occurrence(short occurrence, Augmentations augmentations)
The occurrence count for a child in a children content model or for the mixed content model group.

Parameters: occurrence The occurrence count for the last element or group. augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: OCCURS_ZERO_OR_ONE OCCURS_ZERO_OR_MORE OCCURS_ONE_OR_MORE

pcdata

public void pcdata(Augmentations augmentations)
The appearance of "#PCDATA" within a group signifying a mixed content model. This method will be the first called following the content model's startGroup().

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: XMLDTDContentModelHandler

separator

public void separator(short separator, Augmentations augmentations)
The separator between choices or sequences of a mixed or children content model.

Parameters: separator The type of children separator. augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: SEPARATOR_CHOICE SEPARATOR_SEQUENCE

setDTDContentModelSource

public void setDTDContentModelSource(XMLDTDContentModelSource source)

startContentModel

public void startContentModel(String elementName, Augmentations augmentations)
The start of a content model. Depending on the type of the content model, specific methods may be called between the call to the startContentModel method and the call to the endContentModel method.

Parameters: elementName The name of the element. augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

startGroup

public void startGroup(Augmentations augmentations)
A start of either a mixed or children content model. A mixed content model will immediately be followed by a call to the pcdata() method. A children content model will contain additional groups and/or elements.

Parameters: augmentations Additional information that may include infoset augmentations.

Throws: XNIException Thrown by handler to signal an error.

See Also: XMLDTDContentModelHandler XMLDTDContentModelHandler

Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.