CXmlUtils Class Reference

class CXmlUtils : public CBase

Misc. libxml2 related utilities.

Library: FeedsEngine.lib

Since
3.0

Inherits from

Constructor & Destructor Documentation

CXmlUtils()

CXmlUtils ( ) [private]

C++ default constructor.

~CXmlUtils()

~CXmlUtils ( ) [virtual]

Destructor.

Member Functions Documentation

AttributeL(TXmlEngElement, const TDesC8 &)

HBufC * AttributeL ( TXmlEngElement aElement,
const TDesC8 & aAttribute
) const

Returns the attribute's value or NULL if the attribute wasn't present.

Since
3.0

Parameters

TXmlEngElement aElement A element.
const TDesC8 & aAttribute The attribute to extract.

CleanupMarkupL(TDes &, TInt)

TBool CleanupMarkupL ( TDes & aBuffer,
TInt aNewLineChar
) const

Remove any markup found in the given descriptor.

Since
3.0

Parameters

TDes & aBuffer The buffer to clean up.
TInt aNewLineChar The char used to insert a newline.

CleanupParseBuffer(TAny *)

void CleanupParseBuffer ( TAny * aPtr ) [private, static]

Cleanup stack callback method to cleanup ParseBufferL.

Since
3.0

Parameters

TAny * aPtr A libxml2 parser context ptr.

CleanupUrlL(TDes &)

void CleanupUrlL ( TDes & aUrl ) const

Resolves any entities and escaped chars in the given url.

Since
3.0

Parameters

TDes & aUrl The url to clean up.

ConstructL()

void ConstructL ( ) [private]

By default Symbian 2nd phase constructor is private.

ExtractSimpleTextL(TXmlEngElement, TInt, TBool)

HBufC * ExtractSimpleTextL ( TXmlEngElement aElement,
TInt aMaxLength,
TBool aFromEnd = EFalse
) const

Performs a deep extraction of the text children of the given node. The result is returned as a 16-bit descriptor. The char encoding is always ucs2. This method is different from ExtractTextL in that it doesn't resolve entities or do any other clean up. It also has a length param.

Since
3.1

Parameters

TXmlEngElement aElement A element.
TInt aMaxLength The max length to extract or 0 to extract the entire string.
TBool aFromEnd = EFalse If ETrue the aMaxLength chars are taken from the end of the string.

ExtractTextL(TXmlEngElement)

HBufC * ExtractTextL ( TXmlEngElement aElement ) const

Performs a deep extraction of the text children of the given node. The result is returned as a 16-bit descriptor. The char encoding is always ucs2.

Since
3.0

Parameters

TXmlEngElement aElement A element.

GetDocumentFirstElement(RXmlEngDocument)

TXmlEngElement GetDocumentFirstElement ( RXmlEngDocument aDocument ) const

Returns the first element in the given document.

Since
3.0

Parameters

RXmlEngDocument aDocument A document.

GetFirstElementChild(TXmlEngElement)

TXmlEngElement GetFirstElementChild ( TXmlEngElement aElement ) const

Returns the first child of the given node.

Since
3.0

Parameters

TXmlEngElement aElement A element.

GetFirstNamedChild(TXmlEngElement, const TDesC8 &)

TXmlEngElement GetFirstNamedChild ( TXmlEngElement aElement,
const TDesC8 & aUtf8Name
) const

Returns the first child of the given node with the provided name. aUtf8Name MUST be null terminated.

Since
3.0

Parameters

TXmlEngElement aElement A element.
const TDesC8 & aUtf8Name

GetNextSiblingElement(TXmlEngElement)

TXmlEngElement GetNextSiblingElement ( TXmlEngElement aElement )

Returns the next sibling of the given node.

Since
3.0

Parameters

TXmlEngElement aElement

IsNamed(TXmlEngElement, const TDesC8 &)

TBool IsNamed ( TXmlEngElement aElement,
const TDesC8 & aUtf8Name
) const

Returns true if the given node has a name of aName. This method doesn't compare the namespace.

Since
3.0

Parameters

TXmlEngElement aElement A element.
const TDesC8 & aUtf8Name

IsNamed(TXmlEngElement, const TDesC8 &, const TDesC8 &)

TBool IsNamed ( TXmlEngElement aElement,
const TDesC8 & aUtf8NameSpace,
const TDesC8 & aUtf8Name
) const

Returns true if the given node has match the given namespace and name.

Since
3.0

Parameters

TXmlEngElement aElement A element.
const TDesC8 & aUtf8NameSpace
const TDesC8 & aUtf8Name

NewL()

CXmlUtils * NewL ( ) [static]

Two-phased constructor.

ParseBufferL(const TDesC8 &, const TDesC &)

RXmlEngDocument ParseBufferL ( const TDesC8 & aBuffer,
const TDesC & aCharSet
) const

Returns a document from the provided buffer.

Since
3.0

Parameters

const TDesC8 & aBuffer A buffer in any char-encoding.
const TDesC & aCharSet The char-set.

ResolveEntitiesL(TDes &)

TBool ResolveEntitiesL ( TDes & aBuffer ) const

Resolves any entities found in aOrig the named entity into its char-value.

Since
3.0

Parameters

TDes & aBuffer The buffer to clean up.

SkipCharsBeforeXmlProlog(const TUint8 **, TInt &)

void SkipCharsBeforeXmlProlog ( const TUint8 ** aString,
TInt & aLen
) const [private]

Skip any chars before the XML-prolog.

Since
3.0

Parameters

const TUint8 ** aString
TInt & aLen The length of the xml buffer.

StripCDataMarkers(TDes &)

TBool StripCDataMarkers ( TDes & aBuffer ) const [private]

Remove any CDATA markers in the given descriptor.

Since
3.1

Parameters

TDes & aBuffer The string to be stripped of markup.

StripMarkupL(TDes &, TInt)

TBool StripMarkupL ( TDes & aBuffer,
TInt aNewLineChar
) const [private]

Remove any markup found in the given descriptor.

Since
3.0

Parameters

TDes & aBuffer The string to be stripped of markup.
TInt aNewLineChar The char used to insert a newline.

Member Data Documentation

RXmlEngDOMImplementation iImpl

RXmlEngDOMImplementation iImpl [private]

TLeakTracker iLeakTracker

TLeakTracker iLeakTracker [private]

CXmlEncoding * iXmlEncoding

CXmlEncoding * iXmlEncoding [private]

CXmlEntity * iXmlEntity

CXmlEntity * iXmlEntity [private]