CSenXmlReader Class Reference

Link against: SenXml.LIB

Capability Information

Required Capabilities

None


#include <SenXmlReader.h>

Detailed Description

Class extends Symbian XML framework parser functionality Callers of this class must register some handler which will then receive XML callback events from underlying Symbian XML framework.
Dll SenXML.dll
Since:
Series60 3.0

Public Member Functions

virtual IMPORT_C  ~CSenXmlReader ()
  Destructor.
virtual IMPORT_C void  SetContentHandler (MSenContentHandlerClient &aContentHandler)
  Method to allow client to register a content event handler (for XML) for the current reader.
virtual IMPORT_C TInt  EnabledParserFeature ()
  Method for checking which feature has been enabled in the parser.
virtual IMPORT_C TInt  ParserFeature ()
TInt  SetParserFeature (TInt aParserFeature)
  Method for enabling a parser feature.
IMPORT_C void  ParseL (const TDesC8 &aBuff)
  Parse an XML buffer.
IMPORT_C void  ParseL (RFs &aRFs, const TDesC &aFileToParse)
  Parse an XML document.
virtual void  OnStartDocumentL (const RDocumentParameters &aDocParam, TInt aErrorCode)
virtual void  OnEndDocumentL (TInt aErrorCode)
virtual void  OnStartElementL (const RTagInfo &aElement, const RAttributeArray &aAttributes, TInt aErrorCode)
virtual void  OnEndElementL (const RTagInfo &aElement, TInt aErrorCode)
virtual void  OnContentL (const TDesC8 &aBytes, TInt aErrorCode)
virtual void  OnStartPrefixMappingL (const RString &aPrefix, const RString &aUri, TInt aErrorCode)
virtual void  OnEndPrefixMappingL (const RString &aPrefix, TInt aErrorCode)
virtual void  OnIgnorableWhiteSpaceL (const TDesC8 &aBytes, TInt aErrorCode)
virtual void  OnSkippedEntityL (const RString &aName, TInt aErrorCode)
virtual void  OnProcessingInstructionL (const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode)
virtual void  OnError (TInt aErrorCode)
  OnError is a callback method signalled by Symbian XML framework.
virtual TAny *  GetExtendedInterface (const TInt32 aUid)
  This method obtains the interface matching the specified UID.

Static Public Member Functions

static IMPORT_C CSenXmlReader NewL ()
  Standard two-phase constructor.
static IMPORT_C CSenXmlReader NewLC ()
  Standard two-phase constructor.
static IMPORT_C CSenXmlReader NewL (TInt aParserFeature)
  A constructor with parser feature enabling.
static IMPORT_C CSenXmlReader NewLC (TInt aParserFeature)
  A constructor with parser feature enabling.
static IMPORT_C CSenXmlReader NewL (const TDesC8 &aParserMimeType)
  A constructor with parser MIME type.
static IMPORT_C CSenXmlReader NewLC (const TDesC8 &aParserMimeType)
  A constructor with parser MIME type.
static IMPORT_C CSenXmlReader NewL (const TDesC8 &aParserMimeType, TInt aParserFeature)
  A constructor with parser MIME type and parser feature enabling.
static IMPORT_C CSenXmlReader NewLC (const TDesC8 &aParserMimeType, TInt aParserFeature)
  A constructor with parser MIME type and parser feature enabling.

Protected Member Functions

IMPORT_C  CSenXmlReader (TInt aParserFeature)
  C++ constructor.
void  ConstructL (const TDesC8 &aParserMimeType)
  Symbian 2nd phase constructor.
void  RecreateParserL ()
  This method re-initializes encapsulated CParser class instance.

Constructor & Destructor Documentation

virtual IMPORT_C CSenXmlReader::~CSenXmlReader  )  [virtual]
 

Destructor.

IMPORT_C CSenXmlReader::CSenXmlReader TInt  aParserFeature  )  [protected]
 

C++ constructor.


Member Function Documentation

void CSenXmlReader::ConstructL const TDesC8 &  aParserMimeType  )  [protected]
 

Symbian 2nd phase constructor.

Parameters:
aParserMimeType  sets the MIME type of this XML parser.
virtual IMPORT_C TInt CSenXmlReader::EnabledParserFeature  )  [virtual]
 

Method for checking which feature has been enabled in the parser.

Since:
Series60 3.0
Returns:
the corresponding integer id of the feature
virtual TAny* CSenXmlReader::GetExtendedInterface const TInt32  aUid  )  [virtual]
 

This method obtains the interface matching the specified UID.

Since:
Series60 3.0
Parameters:
aUid  the UID identifying the required interface.
Returns:
NULL if no interface matching the UID is found or if content handler was not set. Otherwise, returns pointer to the interface.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewL const TDesC8 &  aParserMimeType,
TInt  aParserFeature
[static]
 

A constructor with parser MIME type and parser feature enabling.

Since:
Series60 3.0
Parameters:
aParserFeature  is typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewL const TDesC8 &  aParserMimeType  )  [static]
 

A constructor with parser MIME type.

Standard two-phase constructor.

Since:
Series60 3.0
Parameters:
aParserMimeType  is the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.
Returns:
pointer to a new CSenXmlReader instance.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewL TInt  aParserFeature  )  [static]
 

A constructor with parser feature enabling.

Uses default parser MIME type "text/xml" (KXmlParserMimeType).

Since:
Series60 3.0
Parameters:
aParserFeature  is typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewL  )  [static]
 

Standard two-phase constructor.

Creates new parser instance using default MIME type "text/xml" (KXmlParserMimeType).

Since:
Series60 3.0
Returns:
pointer to a new CSenXmlReader instance.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewLC const TDesC8 &  aParserMimeType,
TInt  aParserFeature
[static]
 

A constructor with parser MIME type and parser feature enabling.

Since:
Series60 3.0
Parameters:
aParserMimeType  is the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.
aParserFeature  is typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewLC const TDesC8 &  aParserMimeType  )  [static]
 

A constructor with parser MIME type.

Since:
Series60 3.0
Parameters:
aParserMimeType  is the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.
Returns:
pointer to a new CSenXmlReader instance which is left on cleanup stack.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewLC TInt  aParserFeature  )  [static]
 

A constructor with parser feature enabling.

Uses default parser MIME type "text/xml" (KXmlParserMimeType).

Since:
Series60 3.0
Parameters:
aParserMimeType  is the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.
aParserFeature  is typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.
static IMPORT_C CSenXmlReader* CSenXmlReader::NewLC  )  [static]
 

Standard two-phase constructor.

Creates new parser instance using default MIME type "text/xml" (KXmlParserMimeType).

Since:
Series60 3.0
Returns:
pointer to a new CSenXmlReader instance which is left on cleanup stack.
virtual void CSenXmlReader::OnContentL const TDesC8 &  aBytes,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0
Parameters:
aBytes  is the actual XML data, content in UTF-8 form
aErrorCode  KErrNone, or some system-wide error code if an error has occured.
virtual void CSenXmlReader::OnEndDocumentL TInt  aErrorCode  )  [virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnEndElementL const RTagInfo &  aElement,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnEndPrefixMappingL const RString &  aPrefix,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnError TInt  aErrorCode  )  [virtual]
 

OnError is a callback method signalled by Symbian XML framework.

Current implementation of this class issues a leave in original ParseL() call on any received by this callback implementation. Used leave code will be the received error code.

Since:
Series60 3.0
Parameters:
aErrorCode  is one of the Symbian XML framework errors listed in XmlFrameworkErrors.h
Currently any s

If content handler was not set, ParseL will leaves with KErrSenXmlContentHandlerNotSet.

virtual void CSenXmlReader::OnIgnorableWhiteSpaceL const TDesC8 &  aBytes,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnProcessingInstructionL const TDesC8 &  aTarget,
const TDesC8 &  aData,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnSkippedEntityL const RString &  aName,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnStartDocumentL const RDocumentParameters &  aDocParam,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnStartElementL const RTagInfo &  aElement,
const RAttributeArray aAttributes,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
virtual void CSenXmlReader::OnStartPrefixMappingL const RString &  aPrefix,
const RString &  aUri,
TInt  aErrorCode
[virtual]
 
Since:
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.
IMPORT_C void CSenXmlReader::ParseL RFs &  aRFs,
const TDesC &  aFileToParse
 

Parse an XML document.

Since:
Series60 3.0
Parameters:
aRFs  An open filesession.
aFileToParse  Filename of file to parse.
IMPORT_C void CSenXmlReader::ParseL const TDesC8 &  aBuff  ) 
 

Parse an XML buffer.

Since:
Series60 3.0
Parameters:
aBuff  Buffer containing document to parse. Note that this method will also leave, if an error is returned from Symbian XML framework. Here are the corresponding enums, and their respective error code values (-1000, -999... and up) (XML-specific errors returned by the XML parser) [from XmlParserErrors.h] EXmlParserError = -1000, EXmlSyntax = 2+EXmlParserError, // -998 EXmlNoElements, // -997 EXmlInvalidToken, // -996 EXmlUnclosedToken, // -995 EXmlPartialChar, // -994 EXmlTagMismatch, // -993 EXmlDuplicateAttribute, // -992 EXmlJunkAfterDocElement, // -991 EXmlPeRef, // -990 EXmlUndefinedEntity, // -989 EXmlRecursiveEntity, // -988 EXmlAsyncEntity, // -987 EXmlBadCharRef, // -986 EXmlBinaryEntityRef, // -985 EXmlAttributeExternalEntityRef, // -984 EXmlMisplacedPi, // -983 EXmlUnknownEncoding, // -982 EXmlIncorrectEncoding, // -981 EXmlUnclosedCdata, // -980 EXmlExternalEntityHandling, // -979 EXmlNotStandalone, // -978 EXmlUnexpectedState, // -977 EXmlEntityDeclInPe, // -976 EXmlDtdRequired, // -975 EXmlFeatureLockedWhileParsing // -974
virtual IMPORT_C TInt CSenXmlReader::ParserFeature  )  [virtual]
 
Deprecated:
void CSenXmlReader::RecreateParserL  )  [protected]
 

This method re-initializes encapsulated CParser class instance.

Since:
Series60 3.0
virtual IMPORT_C void CSenXmlReader::SetContentHandler MSenContentHandlerClient aContentHandler  )  [virtual]
 

Method to allow client to register a content event handler (for XML) for the current reader.

Since:
Series60 3.0
Parameters:
aContentHandler  The new event handler.
TInt CSenXmlReader::SetParserFeature TInt  aParserFeature  ) 
 

Method for enabling a parser feature.

Since:
Series60 3.0
Parameters:
aParserFeature  is typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation.
Returns:
KErrNone or some system-wide error code, if an error has occurred.

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

Copyright © Nokia Corporation 2001-2007
Back to top