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.2 2001/08/23 00:35:36 lehors Exp $
Author:
Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000, Andy Clark, IBM
See Also:
XMLDTDHandler

Field Summary
static short OCCURS_ONE_OR_MORE
          This occurrence count limits the element, choice, or sequence in a children content model to one or more.
static short OCCURS_ZERO_OR_MORE
          This occurrence count limits the element, choice, or sequence in a children content model to zero or more.
static short OCCURS_ZERO_OR_ONE
          This occurrence count limits the element, choice, or sequence in a children content model to zero or one.
static short SEPARATOR_CHOICE
          A choice separator for children and mixed content models.
static short SEPARATOR_SEQUENCE
          A sequence separator for children content models.
 
Method Summary
 void any()
          A content model of ANY.
 void element(java.lang.String elementName)
          A referenced element in a mixed or children content model.
 void empty()
          A content model of EMPTY.
 void endContentModel()
          The end of a content model.
 void endGroup()
          The end of a group for mixed or children content models.
 void occurrence(short occurrence)
          The occurrence count for a child in a children content model or for the mixed content model group.
 void pcdata()
          The appearance of "#PCDATA" within a group signifying a mixed content model.
 void separator(short separator)
          The separator between choices or sequences of a mixed or children content model.
 void startContentModel(java.lang.String elementName)
          The start of a content model.
 void startGroup()
          A start of either a mixed or children content model.
 

Field Detail

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

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

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_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
Method Detail

startContentModel

public void startContentModel(java.lang.String elementName)
                       throws XNIException
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.
Throws:
XNIException - Thrown by handler to signal an error.

any

public void any()
         throws XNIException
A content model of ANY.
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
empty(), startGroup()

empty

public void empty()
           throws XNIException
A content model of EMPTY.
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
any(), startGroup()

startGroup

public void startGroup()
                throws XNIException
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.
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
any(), empty()

pcdata

public void pcdata()
            throws XNIException
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().
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
startGroup()

element

public void element(java.lang.String elementName)
             throws XNIException
A referenced element in a mixed or children content model.
Parameters:
elementName - The name of the referenced element.
Throws:
XNIException - Thrown by handler to signal an error.

separator

public void separator(short separator)
               throws XNIException
The separator between choices or sequences of a mixed or children content model.
Parameters:
separator - The type of children separator.
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
SEPARATOR_CHOICE, SEPARATOR_SEQUENCE

occurrence

public void occurrence(short occurrence)
                throws XNIException
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.
Throws:
XNIException - Thrown by handler to signal an error.
See Also:
OCCURS_ZERO_OR_ONE, OCCURS_ZERO_OR_MORE, OCCURS_ONE_OR_MORE

endGroup

public void endGroup()
              throws XNIException
The end of a group for mixed or children content models.
Throws:
XNIException - Thrown by handler to signal an error.

endContentModel

public void endContentModel()
                     throws XNIException
The end of a content model.
Throws:
XNIException - Thrown by handler to signal an error.


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.