XMLPULL V1 API Features

Please note: the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Standard features

Features listed here should be recognized by all XMLPULL implementations however the implementations MUST only implemented default feature semantics that are for false value with exception of FEATURE_PROCESS_DOCDECL and FEATURE_VALIDATION that default MAY be true or false and MAY be immutable (for example if parser is validating and does not allow to switch to non-validating mode).

FEATURE_PROCESS_NAMESPACES

The feature is identified by http://xmlpull.org/v1/doc/features.html#process-namespaces

If set to false XML namespaces not will be process and will be treated as normal attributes. If set to true than XML namespaces MUST be processed according to Namespaces in XML specification.

Processing of namespaces in XMLPULL V1 parser is by default set to false.

This feature can not be changed during parsing!

 

FEATURE_REPORT_NAMESPACE_ATTRIBUTES
 

The feature is identified by http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes

It is off by default and only meaningful when FEATURE_PROCESS_NAMESPACES feature is on.

When set to true then XMLPULL parser MUST report namespace attributes also - they can be distinguished looking for prefix == "xmlns" or prefix == "" and name == "xmlns

This feature can not be changed during parsing!

 

FEATURE_PROCESS_DOCDECL

Identified by http://xmlpull.org/v1/doc/features.html#process-docdecl

Processing of DOCDECL is by default set to false and if DOCDECL is encountered it is reported by nextToken() and ignored by next().

If processing is set to true then DOCDECL must be processed by parser. If FEATURE_VALIDATION is false then parser MUST be non validating as defined in XML 1.0 specification otherwise if FEATURE_VALIDATION .is true then parser MUST be validating as defined in XML 1.0 specification.

If the DOCDECL was ignored further in parsing there may be fatal exception when undeclared entity is encountered!

This feature can not be changed during parsing!

 

FEATURE_VALIDATION

Identified by http://xmlpull.org/v1/doc/features.html#validation
 

Report all validation errors as defined by XML 1.0 sepcification (implies that FEATURE_PROCESS_DOCDECL is true and both internal and external DOCDECL will be processed).

It can can not be changed during parsing!

Optional features

They may be supported but are not part of XMLPULL API

FEATURE_XML_ROUNDTRIP
 

This feature is identified by http://xmlpull.org/v1/doc/features.html#xml-roundtrip

If set to true then XMLPULL parser MUST report original XML value for START_TAG and END_TAG events with getText() and getTextCharacters() functions.
 


Aleksander Slominski