Cross-Platform C++

ot::sax
class SAXFeatures

#include "ot/sax/SAXFeatures.h"

Helper class containing convenient constant values for all the SAX features supported by the OpenTop XMLReader.

For convenience, use the constant data members from this class when setting features on an XMLReader. Here is an example of how the SAXFeatures static data members can be used in place of the long feature names:

    // Create a XMLReader
    RefPtr<XMLReader> rpReader = XMLReaderFactory::CreateXMLReader();
    // Switch on validation
    rpReader->setFeature(SAXFeatures::validation, true);
    // Switch off namespace support
    rpReader->setFeature(SAXFeatures::namespaces, false);


SAX2 Standard Feature Flags

SAX defines standard feature URIs with the prefix http://xml.org/sax/features/ before an identifier such as validation.

The standard features supported by the OpenTop XMLReader are:-

Feature ID Default Description
external-general-entities true Reports whether this parser processes external general entities; always true if validating.
external-parameter-entities true Reports whether this parser processes external parameter entities; always true if validating.
is-standalone none May be examined only during a parse, after (but not during) the startDocument() callback has been made; read-only. The value is true if the document specified the "standalone" flag in its XML declaration, otherwise is false.
lexical-handler/parameter-entities false true indicates that the LexicalHandler will report the beginning and end of parameter entities.
namespaces true true indicates namespace URIs and unprefixed local names for element and attribute names will be available.
namespace-prefixes false true indicates XML 1.0 names (with prefixes) and attributes (including xmlns* attributes) will be available.
resolve-dtd-uris true A value of true indicates that system IDs in declarations will be absolutized (relative to their base URIs) before reporting. (That is the default behavior for all SAX2 XML parsers.) A value of false indicates those IDs will not be absolutized; parsers will provide the base URI from Locator::getSystemId(). This applies to system IDs passed in It does not apply to EntityResolver::resolveEntity(), which is not used to report declarations, or to LexicalHandler::startDTD(), which already provides the non-absolutized URI.
validation false controls whether the parser is reporting all validity errors; if true, all external entities will be read.


OpenTop Extended Feature Flags

OpenTop provides some additions to the core SAX features. They are represented by absolute URIs starting with the prefix http://elcel.com/opentop/sax/features/. The extended features supported by the OpenTop XMLReader are:-

Feature ID Default Description
resolve-entity-uris false A value of true indicates that system IDs reported by Locator::getSystemId() and EntityResolver::resolveEntity() will be absolutized (relative to their base URIs) before reporting. (That is the default behavior for all SAX2 XML parsers.) A value of false indicates those IDs will not be absolutized.
interoperability false A value of true indicates that additional checks will be enabled which test the XML input stream for interoperability with SGML-based systems.
warnings false A value of true indicates that additional checks will be enabled which perform tests that are deemed to be of low importance and result in ErrorHandler::warning() events when triggered.
validate-namespace-declarations true A value of true indicates that namespace declaration attributes (those beginning with xmlns) will be subject to DTD validation just like any other attributes. A value of false makes the parser treat all namespace declarations as if they have been implicitly defined in the DTD.




Public Static Data Members

enable_relative_namespace_uri_test

const String enable_relative_namespace_uri_test

Data member representing the constant URI http://elcel.com/opentop/sax/features/enable-relative-namespace-uri-test.



external_general_entities

const String external_general_entities

Data member representing the constant URI http://xml.org/sax/features/external-general-entities.



external_parameter_entities

const String external_parameter_entities

Data member representing the constant URI http://xml.org/sax/features/external-parameter-entities.



interoperability

const String interoperability

Data member representing the constant URI http://elcel.com/opentop/sax/features/interoperability.



is_standalone

const String is_standalone

Data member representing the constant URI http://xml.org/sax/features/lexical-handler/is-standalone.



lexical_handler_parameter_entities

const String lexical_handler_parameter_entities

Data member representing the constant URI http://xml.org/sax/features/lexical-handler/parameter-entities.



namespace_prefixes

const String namespace_prefixes

Data member representing the constant URI http://xml.org/sax/features/namespace-prefixes.



namespaces

const String namespaces

Data member representing the constant URI http://xml.org/sax/features/namespaces.



resolve_dtd_uris

const String resolve_dtd_uris

Data member representing the constant URI http://xml.org/sax/features/lexical-handler/resolve-dtd-uris.



resolve_entity_uris

const String resolve_entity_uris

Data member representing the constant URI http://elcel.com/opentop/sax/features/resolve-entity-uris.



validate_namespace_declarations

const String validate_namespace_declarations

Data member representing the constant URI http://elcel.com/opentop/sax/features/validate-namespace-declarations.



validation

const String validation

Data member representing the constant URI http://xml.org/sax/features/validation.



warnings

const String warnings

Data member representing the constant URI http://elcel.com/opentop/sax/features/warnings.



Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2003 ElCel Technology   Trademark Acknowledgements