BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balxml::ValidatingReader Class Referenceabstract

#include <balxml_validatingreader.h>

Inheritance diagram for balxml::ValidatingReader:
balxml::Reader

Public Member Functions

 ~ValidatingReader () BSLS_KEYWORD_OVERRIDE
 Destroy this object.
 
virtual void enableValidation (bool validationFlag)=0
 
virtual int addSchema (const char *location, bsl::streambuf *schema)=0
 
virtual void removeSchemas ()=0
 
virtual bool validationFlag () const =0
 Return true if the reader has validation turned on false otherwise.
 
- Public Member Functions inherited from balxml::Reader
virtual ~Reader (void)
 
void dumpNode (bsl::ostream &os) const
 
bool isFatalError () const
 
bool isError () const
 
bool isWarning () const
 
virtual void setPrefixStack (PrefixStack *prefixes)=0
 
virtual void setResolver (XmlResolverFunctor resolver)=0
 
virtual int open (const char *filename, const char *encoding=0)=0
 
virtual int open (const char *buffer, bsl::size_t size, const char *url=0, const char *encoding=0)=0
 
virtual int open (bsl::streambuf *stream, const char *url=0, const char *encoding=0)=0
 
virtual void close ()=0
 
virtual int advanceToNextNode ()=0
 
virtual int lookupAttribute (ElementAttribute *attribute, int index) const =0
 
virtual int lookupAttribute (ElementAttribute *attribute, const char *qname) const =0
 
virtual int lookupAttribute (ElementAttribute *attribute, const char *localName, const char *namespaceUri) const =0
 
virtual int lookupAttribute (ElementAttribute *attribute, const char *localName, int namespaceId) const =0
 
virtual void setOptions (unsigned int flags)=0
 
virtual const char * documentEncoding () const =0
 
virtual XmlResolverFunctor resolver () const =0
 Return the external XML resource resolver.
 
virtual bool isOpen () const =0
 
virtual const ErrorInfoerrorInfo () const =0
 
virtual int getLineNumber () const =0
 
virtual int getColumnNumber () const =0
 
virtual PrefixStackprefixStack () const =0
 
virtual NodeType nodeType () const =0
 
virtual const char * nodeName () const =0
 
virtual const char * nodeLocalName () const =0
 
virtual const char * nodePrefix () const =0
 
virtual int nodeNamespaceId () const =0
 
virtual const char * nodeNamespaceUri () const =0
 
virtual const char * nodeBaseUri () const =0
 
virtual bool nodeHasValue () const =0
 Return true if the current node has a value and false otherwise.
 
virtual const char * nodeValue () const =0
 
virtual int nodeDepth () const =0
 
virtual int numAttributes () const =0
 
virtual bool isEmptyElement () const =0
 
virtual unsigned int options () const =0
 Return the option flags.
 

Additional Inherited Members

- Public Types inherited from balxml::Reader
enum  NodeType {
  e_NODE_TYPE_NONE = 0 , e_NODE_TYPE_ELEMENT = 1 , e_NODE_TYPE_TEXT = 2 , e_NODE_TYPE_CDATA = 3 ,
  e_NODE_TYPE_ENTITY_REFERENCE = 4 , e_NODE_TYPE_ENTITY = 5 , e_NODE_TYPE_PROCESSING_INSTRUCTION = 6 , e_NODE_TYPE_COMMENT = 7 ,
  e_NODE_TYPE_DOCUMENT = 8 , e_NODE_TYPE_DOCUMENT_TYPE = 9 , e_NODE_TYPE_DOCUMENT_FRAGMENT = 10 , e_NODE_TYPE_NOTATION = 11 ,
  e_NODE_TYPE_WHITESPACE = 12 , e_NODE_TYPE_SIGNIFICANT_WHITESPACE = 13 , e_NODE_TYPE_END_ELEMENT = 14 , e_NODE_TYPE_END_ENTITY = 15 ,
  e_NODE_TYPE_XML_DECLARATION = 16 , BAEXML_NODE_TYPE_NONE = e_NODE_TYPE_NONE , BAEXML_NODE_TYPE_ELEMENT = e_NODE_TYPE_ELEMENT , BAEXML_NODE_TYPE_TEXT = e_NODE_TYPE_TEXT ,
  BAEXML_NODE_TYPE_CDATA = e_NODE_TYPE_CDATA , BAEXML_NODE_TYPE_ENTITY_REFERENCE = e_NODE_TYPE_ENTITY_REFERENCE , BAEXML_NODE_TYPE_ENTITY = e_NODE_TYPE_ENTITY , BAEXML_NODE_TYPE_PROCESSING_INSTRUCTION ,
  BAEXML_NODE_TYPE_COMMENT = e_NODE_TYPE_COMMENT , BAEXML_NODE_TYPE_DOCUMENT = e_NODE_TYPE_DOCUMENT , BAEXML_NODE_TYPE_DOCUMENT_TYPE = e_NODE_TYPE_DOCUMENT_TYPE , BAEXML_NODE_TYPE_DOCUMENT_FRAGMENT = e_NODE_TYPE_DOCUMENT_FRAGMENT ,
  BAEXML_NODE_TYPE_NOTATION = e_NODE_TYPE_NOTATION , BAEXML_NODE_TYPE_WHITESPACE = e_NODE_TYPE_WHITESPACE , BAEXML_NODE_TYPE_SIGNIFICANT_WHITESPACE , BAEXML_NODE_TYPE_END_ELEMENT = e_NODE_TYPE_END_ELEMENT ,
  BAEXML_NODE_TYPE_END_ENTITY = e_NODE_TYPE_END_ENTITY , BAEXML_NODE_TYPE_XML_DECLARATION = e_NODE_TYPE_XML_DECLARATION , NODE_TYPE_NONE = e_NODE_TYPE_NONE , NODE_TYPE_ELEMENT = e_NODE_TYPE_ELEMENT ,
  NODE_TYPE_TEXT = e_NODE_TYPE_TEXT , NODE_TYPE_CDATA = e_NODE_TYPE_CDATA , NODE_TYPE_ENTITY_REFERENCE = e_NODE_TYPE_ENTITY_REFERENCE , NODE_TYPE_ENTITY = e_NODE_TYPE_ENTITY ,
  NODE_TYPE_PROCESSING_INSTRUCTION , NODE_TYPE_COMMENT = e_NODE_TYPE_COMMENT , NODE_TYPE_DOCUMENT = e_NODE_TYPE_DOCUMENT , NODE_TYPE_DOCUMENT_TYPE = e_NODE_TYPE_DOCUMENT_TYPE ,
  NODE_TYPE_DOCUMENT_FRAGMENT = e_NODE_TYPE_DOCUMENT_FRAGMENT , NODE_TYPE_NOTATION = e_NODE_TYPE_NOTATION , NODE_TYPE_WHITESPACE = e_NODE_TYPE_WHITESPACE , NODE_TYPE_SIGNIFICANT_WHITESPACE ,
  NODE_TYPE_END_ELEMENT = e_NODE_TYPE_END_ELEMENT , NODE_TYPE_END_ENTITY = e_NODE_TYPE_END_ENTITY , NODE_TYPE_XML_DECLARATION = e_NODE_TYPE_XML_DECLARATION
}
 
typedef bslma::ManagedPtr< bsl::streambuf > StreamBufPtr
 
typedef bsl::function< StreamBufPtr(const char *location, const char *namespaceUri)> XmlResolverFunctor
 
- Static Public Member Functions inherited from balxml::Reader
static const char * nodeTypeAsString (NodeType nodeType)
 

Detailed Description

TBD Class description

See balxml_validatingreader

Constructor & Destructor Documentation

◆ ~ValidatingReader()

balxml::ValidatingReader::~ValidatingReader ( )

Member Function Documentation

◆ addSchema()

virtual int balxml::ValidatingReader::addSchema ( const char *  location,
bsl::streambuf *  schema 
)
pure virtual

Associate the specified location with the XSD document in the specified schema stream. Return 0 on success and non-zero on error. This method may be called more than once to add multiple location-schema associations to a pre-resolved schema cache. During XML validation, a reference to a schema with a specific location will be looked up in the schema cache. Only if this resolution fails, is the schema resolver used to find the external schema. (See setResolver in the Reader base class.) The effects of calling this method when the reader is already open is not specified and a derived class implementation may treat it as an error. The behavior is undefined unless schema is a repositionable stream (i.e., it must be possible to read from the stream, then seek to the beginning of the stream and read the same bytes again.)

◆ enableValidation()

virtual void balxml::ValidatingReader::enableValidation ( bool  validationFlag)
pure virtual

Enable or disable XML validation, if the specified validationFlag is true and disable it otherwise. A validating reader is often faster if validation is disabled. This operation does not take effect until the next call to the open method.

◆ removeSchemas()

virtual void balxml::ValidatingReader::removeSchemas ( )
pure virtual

Remove all location-to-schema associations that were added using addSchema. This method should be called each time after parsing is finished and the reader would be re-used for parsing other documents with different schemas. Note that calling close on the reader does not remove the schemas.

◆ validationFlag()

virtual bool balxml::ValidatingReader::validationFlag ( ) const
pure virtual

The documentation for this class was generated from the following file: