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(TXmlEngElementaElement,
const TDesC8 &aAttribute
)const

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

Since
3.0

Parameters

TXmlEngElement aElementA element.
const TDesC8 & aAttributeThe attribute to extract.

CleanupMarkupL(TDes &, TInt)

TBool CleanupMarkupL(TDes &aBuffer,
TIntaNewLineChar
)const

Remove any markup found in the given descriptor.

Since
3.0

Parameters

TDes & aBufferThe buffer to clean up.
TInt aNewLineCharThe char used to insert a newline.

CleanupParseBuffer(TAny *)

voidCleanupParseBuffer(TAny *aPtr)[private, static]

Cleanup stack callback method to cleanup ParseBufferL.

Since
3.0

Parameters

TAny * aPtrA libxml2 parser context ptr.

CleanupUrlL(TDes &)

voidCleanupUrlL(TDes &aUrl)const

Resolves any entities and escaped chars in the given url.

Since
3.0

Parameters

TDes & aUrlThe url to clean up.

ConstructL()

voidConstructL()[private]

By default Symbian 2nd phase constructor is private.

ExtractSimpleTextL(TXmlEngElement, TInt, TBool)

HBufC *ExtractSimpleTextL(TXmlEngElementaElement,
TIntaMaxLength,
TBoolaFromEnd = 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 aElementA element.
TInt aMaxLengthThe max length to extract or 0 to extract the entire string.
TBool aFromEnd = EFalseIf ETrue the aMaxLength chars are taken from the end of the string.

ExtractTextL(TXmlEngElement)

HBufC *ExtractTextL(TXmlEngElementaElement)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 aElementA element.

GetDocumentFirstElement(RXmlEngDocument)

TXmlEngElement GetDocumentFirstElement(RXmlEngDocumentaDocument)const

Returns the first element in the given document.

Since
3.0

Parameters

RXmlEngDocument aDocumentA document.

GetFirstElementChild(TXmlEngElement)

TXmlEngElement GetFirstElementChild(TXmlEngElementaElement)const

Returns the first child of the given node.

Since
3.0

Parameters

TXmlEngElement aElementA element.

GetFirstNamedChild(TXmlEngElement, const TDesC8 &)

TXmlEngElement GetFirstNamedChild(TXmlEngElementaElement,
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 aElementA element.
const TDesC8 & aUtf8Name

GetNextSiblingElement(TXmlEngElement)

TXmlEngElement GetNextSiblingElement(TXmlEngElementaElement)

Returns the next sibling of the given node.

Since
3.0

Parameters

TXmlEngElement aElement

IsNamed(TXmlEngElement, const TDesC8 &)

TBool IsNamed(TXmlEngElementaElement,
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 aElementA element.
const TDesC8 & aUtf8Name

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

TBool IsNamed(TXmlEngElementaElement,
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 aElementA 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 & aBufferA buffer in any char-encoding.
const TDesC & aCharSetThe 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 & aBufferThe buffer to clean up.

SkipCharsBeforeXmlProlog(const TUint8 **, TInt &)

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

Skip any chars before the XML-prolog.

Since
3.0

Parameters

const TUint8 ** aString
TInt & aLenThe 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 & aBufferThe string to be stripped of markup.

StripMarkupL(TDes &, TInt)

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

Remove any markup found in the given descriptor.

Since
3.0

Parameters

TDes & aBufferThe string to be stripped of markup.
TInt aNewLineCharThe 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]