#include <xml/dom/xmlengdomparser.h>
class RXmlEngDOMParser |
Public Member Functions | |
---|---|
RXmlEngDOMParser() | |
IMPORT_C void | Close() |
IMPORT_C RXmlEngDocument | FinishL() |
IMPORT_C TInt | GetLastParsingError() |
IMPORT_C TInt | Open(RXmlEngDOMImplementation &) |
IMPORT_C void | ParseChunkL(const TDesC8 &) |
IMPORT_C RXmlEngDocument | ParseFileL(RFs &, const TDesC &, TUint) |
IMPORT_C RXmlEngDocument | ParseFileL(const TDesC &, TUint) |
IMPORT_C RXmlEngDocument | ParseL(const TDesC8 &) |
This class implements methods for parsing XML data. XML data may be parsed from a chunk, file, or memory buffer.
RXmlEngDOMImplementation domImpl; domImpl.OpenL(); // opening DOM implementation object RXmlEngDOMParser parser; parser.Open( domImpl ); // opening parser object RXmlEngDocument iDoc; iDoc =parser.ParseL( *aInput ); // parsing aInput - buffer iDoc.Close(); // closing all opened objects parser.Close(); domImpl.Close();
RXmlEngDOMImplementation domImpl; domImpl.OpenL(); // opening DOM implementation object RXmlEngDOMParser parser; parser.Open( domImpl ); // opening parser object RXmlEngDocument iDoc; iDoc =parser.ParseFileL( aFileName ); // parsing from file iDoc.Close(); // closing all openend objects parser.Close(); domImpl.Close();
IMPORT_C RXmlEngDocument | FinishL | ( | ) |
Creates a document from chunks of data previously parsed by ParseChunkL(). Should be called after parsing all chunks. Ownership of the returned RXmlEngDocument object is transferred to the caller of the method. RXmlEngDocument::Close() must be called when the document is no longer required.
See also: ParseChunkL()
See also: GetLastParsingError()
Leave Codes | |
---|---|
KXmlEngErrParsing | Parsing error |
KXmlEngErrWrongUseOfAPI | OpenL() or |
IMPORT_C TInt | GetLastParsingError | ( | ) |
Return last parsing error code. Error codes are positive numbers.
See also: xmlengerrors.h
IMPORT_C TInt | Open | ( | RXmlEngDOMImplementation & | aDOMImpl | ) |
Opens the parser. The RXmlEngDOMImplementation object passed as an argument may be used by multiple RXmlEngDOMParser objects.
Parameters | |
---|---|
aDOMImpl | DOM implementation object previously opened without error. |
IMPORT_C void | ParseChunkL | ( | const TDesC8 & | aBuffer | ) |
Parses a chunk of XML data from a memory buffer and builds an internal DOM tree. The DOM tree can be accessed by calling FinishL() to obtain a RXmlEngDocument.
See also: FinishL()
See also: GetLastParsingError()
Parameters | |
---|---|
aBuffer | XML data buffer |
Leave Codes | |
---|---|
KXmlEngErrParsing | Parsing error |
KXmlEngErrWrongUseOfAPI | OpenL() not previously called |
IMPORT_C RXmlEngDocument | ParseFileL | ( | RFs & | aRFs, |
const TDesC & | aFileName, | |||
TUint | aChunkSize = 0 | |||
) |
Parses XML file and builds a DOM RXmlEngDocument. Ownership of the returned RXmlEngDocument object is transferred to the caller of the method. RXmlEngDocument::Close() must be called when the document is no longer required.
See also: GetLastParsingError()
Parameters | |
---|---|
aRFs | Open file server session |
aFileName | File name |
aChunkSize | The number of bytes to parse from the file at a time, or 0 if the whole file should be parsed at once. |
Leave Codes | |
---|---|
KXmlEngErrParsing | Parsing error |
KXmlEngErrWrongUseOfAPI | OpenL() not previously called |
IMPORT_C RXmlEngDocument | ParseFileL | ( | const TDesC & | aFileName, |
TUint | aChunkSize = 0 | |||
) |
Parses XML file and builds a DOM RXmlEngDocument. Ownership of the returned RXmlEngDocument object is transferred to the caller of the method. RXmlEngDocument::Close() must be called when the document is no longer required.
See also: GetLastParsingError()
Parameters | |
---|---|
aFileName | File name |
aChunkSize | The number of bytes to parse from the file at a time, or 0 if the whole file should be parsed at once. |
Leave Codes | |
---|---|
KXmlEngErrParsing | Parsing error |
KXmlEngErrWrongUseOfAPI | OpenL() not previously called |
IMPORT_C RXmlEngDocument | ParseL | ( | const TDesC8 & | aBuffer | ) |
Parses XML data from a memory buffer that holds the entire XML structure and builds a DOM RXmlEngDocument. Ownership of the returned RXmlEngDocument object is transferred to the caller of the method. RXmlEngDocument::Close() must be called when the document is no longer required.
See also: ParseChunkL()
See also: GetLastParsingError()
Parameters | |
---|---|
aBuffer | XML data buffer |
Leave Codes | |
---|---|
KXmlEngErrParsing | Parsing error |
KXmlEngErrWrongUseOfAPI | OpenL() not previously called |