API published in: S60 3rd Ed
Link against: senxml.lib
Required Capabilities
None
#include <senbasefragment.h>
Inherits CSenFragment, and MSenContentHandlerClient.
Inherited by CSenCredential, CSenDomFragment, CSenSoapEnvelope, and CSenWsSecurityHeader.
The element is identified by localname (or qualifiedname) and namespace. All child elements between start tag and and end tag defined this fragment will become content of this BaseFragment. In other words, BaseFragment has all data inside a single element. BaseFragment will parse only namespace (xmlns) attributes from a document and rest of the attributes are to be handled by subclasses, which should overwrite SetAttributesL() method to achieve this. The CSenXmlReader class will do the actual parsing and this class will act as content handler for XML parser SAX events.
Public Member Functions |
|
virtual IMPORT_C | ~CSenBaseFragment () |
Destructor. |
|
virtual IMPORT_C TPtrC8 | Content () |
Getter for the content,which is returned as UTF-8 form XML. |
|
virtual IMPORT_C CSenNamespace * | Namespace (const TDesC8 &aPrefix) |
Gets the namespace object with a given prefix. |
|
virtual IMPORT_C void | EnsureNamespace (const TDesC8 &aPrefix) |
virtual IMPORT_C void | DetachL () |
virtual IMPORT_C void | SaveNamespacesL (const RAttributeArray &aAttrs, TBool aEnsure) |
virtual IMPORT_C void | ResetContentL () |
Resets the content of the fragment, and resets the namespaces. |
|
virtual IMPORT_C const TDesC8 & | LocalName () const |
virtual IMPORT_C const TDesC8 & | NsUri () const |
Getter for Fragment's namespace URI. |
|
virtual IMPORT_C const TDesC8 & | NsPrefix () const |
Getter for namespace prefix of this fragment. |
|
virtual IMPORT_C CSenElement & | AsElement () |
Getting the fragment as an XML element. |
|
virtual IMPORT_C CSenElement * | ExtractElement () |
Etracts the XML element from the fragment, leaving the fragment empty. |
|
virtual IMPORT_C CSenXmlReader * | Reader () |
Gets the XML reader which this fragment uses for parsing. |
|
virtual IMPORT_C void | SetReader (CSenXmlReader &aReader) |
Sets the XML reader to be used for parsing for the fragment. |
|
virtual IMPORT_C void | ParseL (const TDesC8 &aXml) |
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. |
|
virtual IMPORT_C TInt | BuildFrom (const TDesC8 &aXml) |
Same as ParseL() except that it doesn't leave in case of an error. |
|
virtual IMPORT_C void | DelegateParsingL (MSenFragment &aDelegate) |
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. |
|
virtual IMPORT_C void | DelegateParsingL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs) |
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. |
|
virtual IMPORT_C void | ParseWithL (CSenXmlReader &aReader) |
Sets the reader for this fragment and sets this to be the content handler of the following SAX events. |
|
virtual IMPORT_C void | SetOwner (MSenFragment &aFragment) |
Sets a new parent for this fragment. |
|
virtual IMPORT_C void | ResumeParsingFromL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. |
|
virtual IMPORT_C void | SetAttributesL (const RAttributeArray &aAttrs) |
Sets the attributes for the fragment. |
|
IMPORT_C void | WriteStartElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs) |
Writes the start element tag to the content stream. |
|
IMPORT_C void | WriteEndElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Writes the end element tag to the content stream. |
|
virtual IMPORT_C HBufC * | AsXmlUnicodeL () |
Gets the fragment data as an unicode XML. |
|
virtual IMPORT_C HBufC8 * | AsXmlL () |
Gets the fragment data as an UTF-8 form XML. |
|
virtual IMPORT_C void | WriteAsXMLToL (RWriteStream &aWs) |
Invokes AsElement()->WriteAsXMLToL(aWs);. |
|
virtual IMPORT_C TBool | ConsistsOfL (MSenFragment &aCandidate) |
Checks if fragment matches to another fragment by its content and child elements. |
|
Static Public Member Functions |
|
static IMPORT_C CSenBaseFragment * | NewL (const CSenElement &aElement) |
Standard 2 phase constructor. |
|
static IMPORT_C CSenBaseFragment * | NewL (const TDesC8 &aLocalName) |
Standard 2 phase constructor. |
|
static IMPORT_C CSenBaseFragment * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Standard 2 phase constructor. |
|
static IMPORT_C CSenBaseFragment * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Standard 2 phase constructor. |
|
static IMPORT_C CSenBaseFragment * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs) |
Standard 2 phase constructor. |
|
static IMPORT_C CSenBaseFragment * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs, CSenElement &aParent) |
Standard 2 phase constructor. |
|
Protected Member Functions |
|
IMPORT_C | CSenBaseFragment () |
C++ default constructor. |
|
IMPORT_C void | BaseConstructL (const CSenElement &aElement) |
BaseConstructL, where an element is given as initializer. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aLocalName) |
BaseConstructL setting XML localname for this fragment. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
BaseConstructL offering possibility to set XML namespace and localname. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Base constructor. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs) |
Base constructor. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs, CSenElement &aParent) |
Base constructor. |
|
IMPORT_C void | BaseConstructL (CSenXmlReader &aReader) |
BaseConstructL() setting the XML reader for this fragment. |
|
virtual IMPORT_C void | AllocContentSaverL () |
Makes the content internal stream for content saving available. |
|
virtual IMPORT_C void | StartElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs) |
Callback function implementing the XML content handler interface. |
|
virtual IMPORT_C void | EndElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Callback function which implement the XML content handler interface. |
|
virtual IMPORT_C void | CharactersL (const TDesC8 &aChars, TInt aStart, TInt aLength) |
Function which implement the XML content handler interface. |
|
IMPORT_C TInt | StartEntity (TDesC8 &aName) |
Callback function which implement the XML content handler interface. |
|
IMPORT_C MSenElement & | SetContentOfL (const TDesC8 &aLocalName, const TDesC8 &aContent) |
Sets content to a child element. |
|
IMPORT_C TPtrC8 | ContentOf (const TDesC8 &aLocalName) |
Gets the content of a given element. |
|
Protected Attributes |
|
TInt | iState |
CSenElement * | ipElement |
CSenXmlReader * | iXmlReader |
MSenFragment * | ipOwner |
RWriteStream | iWs |
|
Destructor. |
|
C++ default constructor. |
|
Makes the content internal stream for content saving available. |
|
Getting the fragment as an XML element. This method will panic if element has not been initialized for any reason.
Implements CSenFragment. |
|
Gets the fragment data as an UTF-8 form XML.
Implements CSenFragment. Reimplemented in CSenXmlServiceDescription. |
|
Gets the fragment data as an unicode XML.
Implements CSenFragment. Reimplemented in CSenXmlServiceDescription. |
|
BaseConstructL() setting the XML reader for this fragment.
Reimplemented in CSenDomFragment. |
|
Base constructor.
Reimplemented in CSenDomFragment. |
|
Base constructor.
Reimplemented in CSenDomFragment. |
|
Base constructor.
Reimplemented in CSenDomFragment. |
|
BaseConstructL offering possibility to set XML namespace and localname.
Reimplemented in CSenDomFragment, and CSenServicePattern. |
|
BaseConstructL setting XML localname for this fragment.
Reimplemented in CSenDomFragment, CSenServicePattern, and CSenWsSecurityHeader. |
|
BaseConstructL, where an element is given as initializer.
Reimplemented in CSenDomFragment. |
|
Same as ParseL() except that it doesn't leave in case of an error. Instead errors are trapped and error is returned. SetReader() must be called before this method can be used.
Implements CSenFragment. |
|
Function which implement the XML content handler interface. Inheriting classes can override these. This one is called when content is starting.
Reimplemented in CSenDomFragment. |
|
Checks if fragment matches to another fragment by its content and child elements. Fragment can contain more data than the given candidate.
Implements CSenFragment. |
|
Getter for the content,which is returned as UTF-8 form XML.
Implements CSenFragment. |
|
Gets the content of a given element.
|
|
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. Creates a new fragment and lets the created MSenFragment handle the following SAX events. This fragment is made the owner of the delegate and the delegate is expected to make this MSenFragment act as receiver for SAX events (callbacks) once it has seen the end element for itself.
Implements CSenFragment. |
|
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. Let the delegate MSenFragment handle the following SAX events. This fragment is made the owner of the delegate and the delegate is expected to make this MSenFragment the receiver of SAX events once it has seen the end element for itself.
Implements CSenFragment. |
|
|
|
Callback function which implement the XML content handler interface. Inheriting classes can override these.
Reimplemented in CSenSoapEnvelope, and CSenXmlServiceDescription. |
|
|
|
Etracts the XML element from the fragment, leaving the fragment empty. Note(!): the return value (CSenElement) STRONGLY suggests that subclasses INHERIT CSenFragment in order properly comply the requirement of the ExtractElement() implementation.
Implements CSenFragment. |
|
Implements CSenFragment. |
|
Gets the namespace object with a given prefix.
|
|
Standard 2 phase constructor.
Reimplemented in CSenCredential, and CSenDomFragment. |
|
Standard 2 phase constructor. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
Reimplemented in CSenCredential, and CSenDomFragment. |
|
Standard 2 phase constructor. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
Reimplemented in CSenDomFragment, and CSenIdentityProvider. |
|
Standard 2 phase constructor. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.
Reimplemented in CSenDomFragment, CSenIdentityProvider, CSenServicePattern, and CSenXmlServiceDescription. |
|
Standard 2 phase constructor. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.
Reimplemented in CSenDomFragment, CSenIdentityProvider, CSenServicePattern, CSenWsSecurityHeader, and CSenXmlServiceDescription. |
|
Standard 2 phase constructor.
Reimplemented in CSenDomFragment. |
|
Getter for namespace prefix of this fragment.
Implements CSenFragment. |
|
Getter for Fragment's namespace URI.
Implements CSenFragment. |
|
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. Method to invoke parsing of a XML data. Note that SetReader() must be called before this method can be used. Note that CSenBaseFragment does not parse any other attributes, but XML namespace attributes only. This is due to allow subclasses to process only those attributes they are interested in, and not others.
Implements CSenFragment. |
|
Sets the reader for this fragment and sets this to be the content handler of the following SAX events.
Implements CSenFragment. Reimplemented in CSenDomFragment. |
|
Gets the XML reader which this fragment uses for parsing.
Implements CSenFragment. |
|
Resets the content of the fragment, and resets the namespaces. |
|
Leave codes: KErrSenXmlReaderNotSet if XML reader has not been set. Resumes parsing to be handled by this fragment. Usually called by some delegate fragment which was set to be content handler because this fragment called DelegateParsingL().
Implements CSenFragment. Reimplemented in CSenDomFragment, and CSenXmlServiceDescription. |
|
|
|
Sets the attributes for the fragment. BaseFragment parses only namespace (xmlns) attributes from the document. Subclasses should override this method if they are intrested of handling any other XML attributes and their corresponding values.
Implements CSenFragment. Reimplemented in CSenDomFragment, and CSenXmlServiceDescription. |
|
Sets content to a child element. If no element with given local name is not found, new one is added and content is set to that one.
|
|
Sets a new parent for this fragment.
Implements CSenFragment. |
|
Sets the XML reader to be used for parsing for the fragment.
Implements CSenFragment. |
|
Callback function implementing the XML content handler interface. Inheriting classes can override these.
Reimplemented in CSenCredential, CSenDomFragment, CSenServicePattern, CSenSoapEnvelope, and CSenXmlServiceDescription. |
|
Callback function which implement the XML content handler interface. Inheriting classes can override these.
|
|
Invokes AsElement()->WriteAsXMLToL(aWs);.
Implements CSenFragment. Reimplemented in CSenXmlServiceDescription. |
|
Writes the end element tag to the content stream. Derivants can override the basic usage used in BaseFragment.
Implements CSenFragment. Reimplemented in CSenDomFragment. |
|
Writes the start element tag to the content stream. Derivants can override the basic usage used in BaseFragment.
Implements CSenFragment. Reimplemented in CSenDomFragment. |
|
|
|
|
|