1/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements.  See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22package com.sun.org.apache.xerces.internal.parsers;
23
24import com.sun.org.apache.xerces.internal.xni.Augmentations;
25import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
26import com.sun.org.apache.xerces.internal.xni.QName;
27import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
28import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
29import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
30import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
31import com.sun.org.apache.xerces.internal.xni.XMLLocator;
32import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
33import com.sun.org.apache.xerces.internal.xni.XMLString;
34import com.sun.org.apache.xerces.internal.xni.XNIException;
35import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
36import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
37import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
38import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
39
40/**
41 * This is the base class for all XML document parsers. XMLDocumentParser
42 * provides a common implementation shared by the various document parsers
43 * in the Xerces package. While this class is provided for convenience, it
44 * does not prevent other kinds of parsers to be constructed using the XNI
45 * interfaces.
46 *
47 * @author Arnaud  Le Hors, IBM
48 * @author Andy Clark, IBM
49 *
50 */
51public abstract class AbstractXMLDocumentParser
52    extends XMLParser
53    implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
54
55    //
56    // Data
57    //
58
59    // state
60
61    /** True if inside DTD. */
62    protected boolean fInDTD;
63
64    /** Document source*/
65    protected XMLDocumentSource fDocumentSource;
66
67    /** DTD source*/
68    protected XMLDTDSource fDTDSource;
69
70    /** DTD content model source*/
71    protected XMLDTDContentModelSource fDTDContentModelSource;
72
73    //
74    // Constructors
75    //
76
77    /**
78     * Constructs a document parser using the default symbol table
79     * and grammar pool.
80     */
81    protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
82        super(config);
83
84        // set handlers
85        config.setDocumentHandler(this);
86        config.setDTDHandler(this);
87        config.setDTDContentModelHandler(this);
88
89    } // <init>(XMLParserConfiguration)
90
91    //
92    // XMLDocumentHandler methods
93    //
94
95    /**
96     * The start of the document.
97     *
98     * @param locator The system identifier of the entity if the entity
99     *                 is external, null otherwise.
100     * @param encoding The auto-detected IANA encoding name of the entity
101     *                 stream. This value will be null in those situations
102     *                 where the entity encoding is not auto-detected (e.g.
103     *                 internal entities or a document entity that is
104     *                 parsed from a java.io.Reader).
105     * @param namespaceContext
106     *                 The namespace context in effect at the
107     *                 start of this document.
108     *                 This object represents the current context.
109     *                 Implementors of this class are responsible
110     *                 for copying the namespace bindings from the
111     *                 the current context (and its parent contexts)
112     *                 if that information is important.
113     * @param augs   Additional information that may include infoset augmentations
114     *
115     * @throws XNIException Thrown by handler to signal an error.
116     */
117
118    public void startDocument(XMLLocator locator, String encoding,
119                              NamespaceContext namespaceContext, Augmentations augs)
120        throws XNIException {
121    } // startDocument(XMLLocator,String)
122
123    /**
124     * Notifies of the presence of an XMLDecl line in the document. If
125     * present, this method will be called immediately following the
126     * startDocument call.
127     *
128     * @param version    The XML version.
129     * @param encoding   The IANA encoding name of the document, or null if
130     *                   not specified.
131     * @param standalone The standalone value, or null if not specified.
132     * @param augs   Additional information that may include infoset augmentations
133     *
134     * @throws XNIException Thrown by handler to signal an error.
135     */
136    public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
137        throws XNIException {
138    } // xmlDecl(String,String,String)
139
140    /**
141     * Notifies of the presence of the DOCTYPE line in the document.
142     *
143     * @param rootElement The name of the root element.
144     * @param publicId    The public identifier if an external DTD or null
145     *                    if the external DTD is specified using SYSTEM.
146     * @param systemId    The system identifier if an external DTD, null
147     * @param augs   Additional information that may include infoset augmentations
148     *                    otherwise.
149     *
150     * @throws XNIException Thrown by handler to signal an error.
151     */
152    public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
153        throws XNIException {
154    } // doctypeDecl(String,String,String)
155
156    /**
157     * The start of an element. If the document specifies the start element
158     * by using an empty tag, then the startElement method will immediately
159     * be followed by the endElement method, with no intervening methods.
160     *
161     * @param element    The name of the element.
162     * @param attributes The element attributes.
163     * @param augs   Additional information that may include infoset augmentations
164     *
165     * @throws XNIException Thrown by handler to signal an error.
166     */
167    public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
168        throws XNIException {
169    } // startElement(QName,XMLAttributes)
170
171    /**
172     * An empty element.
173     *
174     * @param element    The name of the element.
175     * @param attributes The element attributes.
176     * @param augs   Additional information that may include infoset augmentations
177     *
178     * @throws XNIException Thrown by handler to signal an error.
179     */
180    public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
181        throws XNIException {
182
183        startElement(element, attributes, augs);
184        endElement(element, augs);
185
186    } // emptyElement(QName,XMLAttributes)
187
188    /**
189     * Character content.
190     *
191     * @param text The content.
192     * @param augs   Additional information that may include infoset augmentations
193     *
194     * @throws XNIException Thrown by handler to signal an error.
195     */
196    public void characters(XMLString text, Augmentations augs) throws XNIException {
197    } // characters(XMLString)
198
199    /**
200     * Ignorable whitespace. For this method to be called, the document
201     * source must have some way of determining that the text containing
202     * only whitespace characters should be considered ignorable. For
203     * example, the validator can determine if a length of whitespace
204     * characters in the document are ignorable based on the element
205     * content model.
206     *
207     * @param text The ignorable whitespace.
208     * @param augs   Additional information that may include infoset augmentations
209     *
210     * @throws XNIException Thrown by handler to signal an error.
211     */
212    public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
213    } // ignorableWhitespace(XMLString)
214
215    /**
216     * The end of an element.
217     *
218     * @param element The name of the element.
219     * @param augs   Additional information that may include infoset augmentations
220     *
221     * @throws XNIException Thrown by handler to signal an error.
222     */
223    public void endElement(QName element, Augmentations augs) throws XNIException {
224    } // endElement(QName)
225
226    /**
227     * The start of a CDATA section.
228     * @param augs   Additional information that may include infoset augmentations
229     *
230     * @throws XNIException Thrown by handler to signal an error.
231     */
232    public void startCDATA(Augmentations augs) throws XNIException {
233    } // startCDATA()
234
235    /**
236     * The end of a CDATA section.
237     * @param augs   Additional information that may include infoset augmentations
238     *
239     * @throws XNIException Thrown by handler to signal an error.
240     */
241    public void endCDATA(Augmentations augs) throws XNIException {
242    } // endCDATA()
243
244    /**
245     * The end of the document.
246     * @param augs   Additional information that may include infoset augmentations
247     *
248     * @throws XNIException Thrown by handler to signal an error.
249     */
250    public void endDocument(Augmentations augs) throws XNIException {
251    } // endDocument()
252
253
254    /**
255     * This method notifies the start of an entity.
256     * <p>
257     * <strong>Note:</strong> This method is not called for entity references
258     * appearing as part of attribute values.
259     *
260     * @param name     The name of the entity.
261     * @param identifier The resource identifier.
262     * @param encoding The auto-detected IANA encoding name of the entity
263     *                 stream. This value will be null in those situations
264     *                 where the entity encoding is not auto-detected (e.g.
265     *                 internal entities or a document entity that is
266     *                 parsed from a java.io.Reader).
267     * @param augs     Additional information that may include infoset augmentations
268     *
269     * @exception XNIException Thrown by handler to signal an error.
270     */
271    public void startGeneralEntity(String name,
272                                   XMLResourceIdentifier identifier,
273                                   String encoding,
274                                   Augmentations augs) throws XNIException {
275    } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
276
277    /**
278     * Notifies of the presence of a TextDecl line in an entity. If present,
279     * this method will be called immediately following the startEntity call.
280     * <p>
281     * <strong>Note:</strong> This method will never be called for the
282     * document entity; it is only called for external general entities
283     * referenced in document content.
284     * <p>
285     * <strong>Note:</strong> This method is not called for entity references
286     * appearing as part of attribute values.
287     *
288     * @param version  The XML version, or null if not specified.
289     * @param encoding The IANA encoding name of the entity.
290     * @param augs     Additional information that may include infoset augmentations
291     *
292     * @exception XNIException
293     *                   Thrown by handler to signal an error.
294     */
295    public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
296    } // textDecl(String, String, Augmentations)
297
298    /**
299     * This method notifies the end of an entity.
300     * <p>
301     * <strong>Note:</strong> This method is not called for entity references
302     * appearing as part of attribute values.
303     *
304     * @param name   The name of the entity.
305     * @param augs   Additional information that may include infoset augmentations
306     *
307     * @exception XNIException
308     *                   Thrown by handler to signal an error.
309     */
310    public void endGeneralEntity(String name, Augmentations augs)
311        throws XNIException {
312    } // endGeneralEntity(String,Augmentations)
313
314    /**
315     * A comment.
316     *
317     * @param text   The text in the comment.
318     * @param augs   Additional information that may include infoset augmentations
319     *
320     * @exception XNIException
321     *                   Thrown by application to signal an error.
322     */
323    public void comment(XMLString text, Augmentations augs) throws XNIException {
324    } // comment (XMLString, Augmentations)
325
326    /**
327     * A processing instruction. Processing instructions consist of a
328     * target name and, optionally, text data. The data is only meaningful
329     * to the application.
330     * <p>
331     * Typically, a processing instruction's data will contain a series
332     * of pseudo-attributes. These pseudo-attributes follow the form of
333     * element attributes but are <strong>not</strong> parsed or presented
334     * to the application as anything other than text. The application is
335     * responsible for parsing the data.
336     *
337     * @param target The target.
338     * @param data   The data or null if none specified.
339     * @param augs   Additional information that may include infoset augmentations
340     *
341     * @exception XNIException
342     *                   Thrown by handler to signal an error.
343     */
344    public void processingInstruction(String target, XMLString data, Augmentations augs)
345        throws XNIException {
346    } // processingInstruction(String, XMLString, Augmentations)
347
348
349    /** Sets the document source */
350    public void setDocumentSource(XMLDocumentSource source){
351        fDocumentSource = source;
352    } // setDocumentSource
353
354    /** Returns the document source */
355    public XMLDocumentSource getDocumentSource (){
356        return fDocumentSource;
357    } // getDocumentSource
358    //
359    // XMLDTDHandler methods
360    //
361
362    /**
363     * The start of the DTD.
364     *
365     * @param locator  The document locator, or null if the document
366     *                 location cannot be reported during the parsing of
367     *                 the document DTD. However, it is <em>strongly</em>
368     *                 recommended that a locator be supplied that can
369     *                 at least report the base system identifier of the
370     *                 DTD.
371     * @param augs Additional information that may include infoset
372     *                      augmentations.
373     *
374     * @throws XNIException Thrown by handler to signal an error.
375     */
376    public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
377        fInDTD = true;
378    } // startDTD(XMLLocator)
379
380
381    /**
382     * The start of the DTD external subset.
383     *
384     * @param augmentations Additional information that may include infoset
385     *                      augmentations.
386     *
387     * @throws XNIException Thrown by handler to signal an error.
388     */
389    public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
390        throws XNIException {
391    } // startExternalSubset(Augmentations)
392
393    /**
394     * The end of the DTD external subset.
395     *
396     * @param augmentations Additional information that may include infoset
397     *                      augmentations.
398     *
399     * @throws XNIException Thrown by handler to signal an error.
400     */
401    public void endExternalSubset(Augmentations augmentations)
402        throws XNIException {
403    } // endExternalSubset(Augmentations)
404
405    /**
406     * This method notifies the start of an entity.
407     * <p>
408     * <strong>Note:</strong> This method is not called for entity references
409     * appearing as part of attribute values.
410     *
411     * @param name     The name of the entity.
412     * @param identifier The resource identifier.
413     * @param encoding The auto-detected IANA encoding name of the entity
414     *                 stream. This value will be null in those situations
415     *                 where the entity encoding is not auto-detected (e.g.
416     *                 internal entities or a document entity that is
417     *                 parsed from a java.io.Reader).
418     * @param augs     Additional information that may include infoset augmentations
419     *
420     * @exception XNIException Thrown by handler to signal an error.
421     */
422    public void startParameterEntity(String name,
423                                     XMLResourceIdentifier identifier,
424                                     String encoding,
425                                     Augmentations augs) throws XNIException {
426    } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
427
428    /**
429     * This method notifies the end of an entity.
430     * <p>
431     * <strong>Note:</strong> This method is not called for entity references
432     * appearing as part of attribute values.
433     *
434     * @param name   The name of the entity.
435     * @param augs   Additional information that may include infoset augmentations
436     *
437     * @exception XNIException
438     *                   Thrown by handler to signal an error.
439     */
440    public void endParameterEntity(String name, Augmentations augs)
441        throws XNIException {
442    } // endParameterEntity(String,Augmentations)
443
444    /**
445     * Characters within an IGNORE conditional section.
446     *
447     * @param text The ignored text.
448     * @param augs Additional information that may include infoset
449     *                      augmentations.
450     *
451     * @throws XNIException Thrown by handler to signal an error.
452     */
453     public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
454     } // ignoredCharacters(XMLString, Augmentations)
455
456    /**
457     * An element declaration.
458     *
459     * @param name         The name of the element.
460     * @param contentModel The element content model.
461     * @param augs Additional information that may include infoset
462     *                      augmentations.
463     *
464     * @throws XNIException Thrown by handler to signal an error.
465     */
466    public void elementDecl(String name, String contentModel, Augmentations augs)
467        throws XNIException {
468    } // elementDecl(String,String)
469
470    /**
471     * The start of an attribute list.
472     *
473     * @param elementName The name of the element that this attribute
474     *                    list is associated with.
475     * @param augs Additional information that may include infoset
476     *                      augmentations.
477     *
478     * @throws XNIException Thrown by handler to signal an error.
479     */
480    public void startAttlist(String elementName, Augmentations augs) throws XNIException {
481    } // startAttlist(String)
482
483    /**
484     * An attribute declaration.
485     *
486     * @param elementName   The name of the element that this attribute
487     *                      is associated with.
488     * @param attributeName The name of the attribute.
489     * @param type          The attribute type. This value will be one of
490     *                      the following: "CDATA", "ENTITY", "ENTITIES",
491     *                      "ENUMERATION", "ID", "IDREF", "IDREFS",
492     *                      "NMTOKEN", "NMTOKENS", or "NOTATION".
493     * @param enumeration   If the type has the value "ENUMERATION" or
494     *                      "NOTATION", this array holds the allowed attribute
495     *                      values; otherwise, this array is null.
496     * @param defaultType   The attribute default type. This value will be
497     *                      one of the following: "#FIXED", "#IMPLIED",
498     *                      "#REQUIRED", or null.
499     * @param defaultValue  The attribute default value, or null if no
500     *                      default value is specified.
501     * @param nonNormalizedDefaultValue  The attribute default value with no normalization
502     *                      performed, or null if no default value is specified.
503     * @param augs Additional information that may include infoset
504     *                      augmentations.
505     *
506     * @throws XNIException Thrown by handler to signal an error.
507     */
508    public void attributeDecl(String elementName, String attributeName,
509                              String type, String[] enumeration,
510                              String defaultType, XMLString defaultValue,
511                              XMLString nonNormalizedDefaultValue, Augmentations augs)
512        throws XNIException {
513    } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
514
515    /**
516     * The end of an attribute list.
517     *
518     * @param augs Additional information that may include infoset
519     *                      augmentations.
520     *
521     * @throws XNIException Thrown by handler to signal an error.
522     */
523    public void endAttlist(Augmentations augs) throws XNIException {
524    } // endAttlist()
525
526    /**
527     * An internal entity declaration.
528     *
529     * @param name The name of the entity. Parameter entity names start with
530     *             '%', whereas the name of a general entity is just the
531     *             entity name.
532     * @param text The value of the entity.
533     * @param nonNormalizedText The non-normalized value of the entity. This
534     *             value contains the same sequence of characters that was in
535     *             the internal entity declaration, without any entity
536     *             references expanded.
537     * @param augs Additional information that may include infoset
538     *                      augmentations.
539     *
540     * @throws XNIException Thrown by handler to signal an error.
541     */
542    public void internalEntityDecl(String name, XMLString text,
543                                   XMLString nonNormalizedText, Augmentations augs)
544        throws XNIException {
545    } // internalEntityDecl(String,XMLString,XMLString)
546
547    /**
548     * An external entity declaration.
549     *
550     * @param name     The name of the entity. Parameter entity names start
551     *                 with '%', whereas the name of a general entity is just
552     *                 the entity name.
553     * @param identifier    An object containing all location information
554     *                      pertinent to this entity.
555     * @param augs Additional information that may include infoset
556     *                      augmentations.
557     *
558     * @throws XNIException Thrown by handler to signal an error.
559     */
560    public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
561                                   Augmentations augs) throws XNIException {
562    } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
563
564    /**
565     * An unparsed entity declaration.
566     *
567     * @param name     The name of the entity.
568     * @param identifier    An object containing all location information
569     *                      pertinent to this entity.
570     * @param notation The name of the notation.
571     * @param augs Additional information that may include infoset
572     *                      augmentations.
573     *
574     * @throws XNIException Thrown by handler to signal an error.
575     */
576    public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
577                                   String notation, Augmentations augs) throws XNIException {
578    } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
579
580    /**
581     * A notation declaration
582     *
583     * @param name     The name of the notation.
584     * @param identifier    An object containing all location information
585     *                      pertinent to this notation.
586     * @param augs Additional information that may include infoset
587     *                      augmentations.
588     *
589     * @throws XNIException Thrown by handler to signal an error.
590     */
591    public void notationDecl(String name, XMLResourceIdentifier identifier,
592        Augmentations augs)
593        throws XNIException {
594    } // notationDecl(String,XMLResourceIdentifier, Augmentations)
595
596    /**
597     * The start of a conditional section.
598     *
599     * @param type The type of the conditional section. This value will
600     *             either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
601     * @param augs Additional information that may include infoset
602     *                      augmentations.
603     *
604     * @throws XNIException Thrown by handler to signal an error.
605     *
606     * @see #CONDITIONAL_INCLUDE
607     * @see #CONDITIONAL_IGNORE
608     */
609    public void startConditional(short type, Augmentations augs) throws XNIException  {
610    } // startConditional(short)
611
612    /**
613     * The end of a conditional section.
614     *
615     * @param augs Additional information that may include infoset
616     *                      augmentations.
617     *
618     * @throws XNIException Thrown by handler to signal an error.
619     */
620    public void endConditional(Augmentations augs) throws XNIException {
621    } // endConditional()
622
623    /**
624     * The end of the DTD.
625     *
626     * @param augs Additional information that may include infoset
627     *                      augmentations.
628     *
629     * @throws XNIException Thrown by handler to signal an error.
630     */
631    public void endDTD(Augmentations augs) throws XNIException {
632        fInDTD = false;
633    } // endDTD()
634
635    // set the source of this handler
636    public void setDTDSource(XMLDTDSource source) {
637        fDTDSource = source;
638    }
639
640    // return the source from which this handler derives its events
641    public XMLDTDSource getDTDSource() {
642        return fDTDSource;
643    }
644
645    //
646    // XMLDTDContentModelHandler methods
647    //
648
649    /**
650     * The start of a content model. Depending on the type of the content
651     * model, specific methods may be called between the call to the
652     * startContentModel method and the call to the endContentModel method.
653     *
654     * @param elementName The name of the element.
655     * @param augs Additional information that may include infoset
656     *                      augmentations.
657     *
658     * @throws XNIException Thrown by handler to signal an error.
659     */
660    public void startContentModel(String elementName, Augmentations augs) throws XNIException {
661    } // startContentModel(String, Augmentations)
662
663    /**
664     * A content model of ANY.
665     *
666     * @param augs Additional information that may include infoset
667     *                      augmentations.
668     *
669     * @throws XNIException Thrown by handler to signal an error.
670     *
671     * @see #empty
672     * @see #startGroup
673     */
674    public void any(Augmentations augs) throws XNIException {
675    } // any(Augmentations)
676
677    /**
678     * A content model of EMPTY.
679     *
680     * @param augs Additional information that may include infoset
681     *                      augmentations.
682     *
683     * @throws XNIException Thrown by handler to signal an error.
684     *
685     * @see #any
686     * @see #startGroup
687     */
688    public void empty(Augmentations augs) throws XNIException {
689    } // empty(Augmentations)
690
691    /**
692     * A start of either a mixed or children content model. A mixed
693     * content model will immediately be followed by a call to the
694     * <code>pcdata()</code> method. A children content model will
695     * contain additional groups and/or elements.
696     *
697     * @param augs Additional information that may include infoset
698     *                      augmentations.
699     *
700     * @throws XNIException Thrown by handler to signal an error.
701     *
702     * @see #any
703     * @see #empty
704     */
705    public void startGroup(Augmentations augs) throws XNIException {
706    } // stargGroup(Augmentations)
707
708    /**
709     * The appearance of "#PCDATA" within a group signifying a
710     * mixed content model. This method will be the first called
711     * following the content model's <code>startGroup()</code>.
712     *
713     * @param augs Additional information that may include infoset
714     *                      augmentations.
715     *
716     * @throws XNIException Thrown by handler to signal an error.
717     *
718     * @see #startGroup
719     */
720    public void pcdata(Augmentations augs) throws XNIException {
721    } // pcdata(Augmentations)
722
723    /**
724     * A referenced element in a mixed or children content model.
725     *
726     * @param elementName The name of the referenced element.
727     * @param augs Additional information that may include infoset
728     *                      augmentations.
729     *
730     * @throws XNIException Thrown by handler to signal an error.
731     */
732    public void element(String elementName, Augmentations augs) throws XNIException {
733    } // element(String, Augmentations)
734
735    /**
736     * The separator between choices or sequences of a mixed or children
737     * content model.
738     *
739     * @param separator The type of children separator.
740     * @param augs Additional information that may include infoset
741     *                      augmentations.
742     *
743     * @throws XNIException Thrown by handler to signal an error.
744     *
745     * @see #SEPARATOR_CHOICE
746     * @see #SEPARATOR_SEQUENCE
747     */
748    public void separator(short separator, Augmentations augs) throws XNIException {
749    } // separator(short, Augmentations)
750
751    /**
752     * The occurrence count for a child in a children content model or
753     * for the mixed content model group.
754     *
755     * @param occurrence The occurrence count for the last element
756     *                   or group.
757     * @param augs Additional information that may include infoset
758     *                      augmentations.
759     *
760     * @throws XNIException Thrown by handler to signal an error.
761     *
762     * @see #OCCURS_ZERO_OR_ONE
763     * @see #OCCURS_ZERO_OR_MORE
764     * @see #OCCURS_ONE_OR_MORE
765     */
766    public void occurrence(short occurrence, Augmentations augs) throws XNIException {
767    } // occurence(short, Augmentations)
768
769    /**
770     * The end of a group for mixed or children content models.
771     *
772     * @param augs Additional information that may include infoset
773     *                      augmentations.
774     *
775     * @throws XNIException Thrown by handler to signal an error.
776     */
777    public void endGroup(Augmentations augs) throws XNIException {
778    } // endGroup(Augmentations)
779
780    /**
781     * The end of a content model.
782     *
783     * @param augs Additional information that may include infoset
784     *                      augmentations.
785     *
786     * @throws XNIException Thrown by handler to signal an error.
787     */
788    public void endContentModel(Augmentations augs) throws XNIException {
789    } // endContentModel(Augmentations)
790
791    // set content model source
792    public void setDTDContentModelSource(XMLDTDContentModelSource source) {
793        fDTDContentModelSource = source;
794    }
795
796    // get content model source
797    public XMLDTDContentModelSource getDTDContentModelSource() {
798        return fDTDContentModelSource;
799    }
800
801    //
802    // Protected methods
803    //
804
805    /**
806     * reset all components before parsing
807     */
808    protected void reset() throws XNIException {
809        super.reset();
810        fInDTD = false;
811    } // reset()
812
813} // class AbstractXMLDocumentParser
814