org.apache.xerces.impl

Class XML11NSDocumentScannerImpl

public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl

The scanner acts as the source for the document information which is communicated to the document handler. This class scans an XML document, checks if document has a DTD, and if DTD is not found the scanner will remove the DTD Validator from the pipeline and perform namespace binding. Note: This scanner should only be used when the namespace processing is on!

This component requires the following features and properties from the component manager that uses it:

Version: $Id: XML11NSDocumentScannerImpl.java,v 1.13 2004/10/04 21:45:49 mrglavas Exp $

Author: Elena Litani, IBM Michael Glavassevich, IBM

UNKNOWN:

Nested Class Summary
protected classXML11NSDocumentScannerImpl.NS11ContentDispatcher
Dispatcher to handle content scanning.
Field Summary
protected booleanfBindNamespaces
If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces
protected booleanfPerformValidation
If validating parser, make sure we report an error in the scanner if DTD grammar is missing.
Method Summary
protected DispatchercreateContentDispatcher()
Creates a content dispatcher.
voidreset(XMLComponentManager componentManager)
protected voidscanAttribute(XMLAttributesImpl attributes)
Scans an attribute.
protected intscanEndElement()
Scans an end element.
protected booleanscanStartElement()
Scans a start element.
protected booleanscanStartElementAfterName()
Scans the remainder of a start or empty tag after the element name.
protected voidscanStartElementName()
Scans the name of an element in a start or empty tag.
voidsetDTDValidator(XMLDTDValidatorFilter validator)
The scanner is responsible for removing DTD validator from the pipeline if it is not needed.

Field Detail

fBindNamespaces

protected boolean fBindNamespaces
If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces

fPerformValidation

protected boolean fPerformValidation
If validating parser, make sure we report an error in the scanner if DTD grammar is missing.

Method Detail

createContentDispatcher

protected Dispatcher createContentDispatcher()
Creates a content dispatcher.

reset

public void reset(XMLComponentManager componentManager)

scanAttribute

protected void scanAttribute(XMLAttributesImpl attributes)
Scans an attribute.

 [41] Attribute ::= Name Eq AttValue
 

Note: This method assumes that the next character on the stream is the first character of the attribute name.

Note: This method uses the fAttributeQName and fQName variables. The contents of these variables will be destroyed.

Parameters: attributes The attributes list for the scanned attribute.

scanEndElement

protected int scanEndElement()
Scans an end element.

 [42] ETag ::= '</' Name S? '>'
 

Note: This method uses the fElementQName variable. The contents of this variable will be destroyed. The caller should copy the needed information out of this variable before calling this method.

Returns: The element depth.

scanStartElement

protected boolean scanStartElement()
Scans a start element. This method will handle the binding of namespace information and notifying the handler of the start of the element.

 [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
 [40] STag ::= '<' Name (S Attribute)* S? '>'
 

Note: This method assumes that the leading '<' character has been consumed.

Note: This method uses the fElementQName and fAttributes variables. The contents of these variables will be destroyed. The caller should copy important information out of these variables before calling this method.

Returns: True if element is empty. (i.e. It matches production [44].

scanStartElementAfterName

protected boolean scanStartElementAfterName()
Scans the remainder of a start or empty tag after the element name.

Returns: True if element is empty.

See Also: XML11NSDocumentScannerImpl

scanStartElementName

protected void scanStartElementName()
Scans the name of an element in a start or empty tag.

See Also: scanStartElement

setDTDValidator

public void setDTDValidator(XMLDTDValidatorFilter validator)
The scanner is responsible for removing DTD validator from the pipeline if it is not needed.

Parameters: validator the DTD validator from the pipeline

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