Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress C++ API Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::XmlReader

Group:  Core XML


rwsf::XmlReaderrwsf::HandleBase

Local Index

Members

Header File

#include rwsf/core/XmlReader.h

Description

Class rwsf::XmlReader implements the handle/body idiom in which rwsf::XmlReaderImp is the body and rwsf::XmlReader is the handle.

rwsf::XmlReader is a simple XML pull-parser. The XML document is typically parsed element by element using readElement(), or by iteratively calling readElementStart(), readElementValue(), and readElementEnd(). On each read, this object sets its internal state with information about what was just read. Member functions getLastNodeType(), getLastName(), and getLastContent() can then be used to retrieve portions of the rwsf::XmlReader's state.

rwsf::XmlReader throws an exception of type rwsf::XmlParseException when it encounters XML that is not well-formed. The rwsf::XmlParseException exception contains a description of the error and the line and column number of the source document where the error occurred.

rwsf::XmlReader can parse documents in the encodings UTF-8, UTF-16(BE), UTF-16LE, US-ASCII, and ISO-8859-1. In addition, if the rwsf_icu library is present, rwsf::XmlReader will also convert from any character encodings supported by the ICU.

For more information on how HydraSCA performs conversions and how to create custom conversions, see Chapter 20, "Internationalizing Your Services," in the HydraSCA Express Web Service Development Guide.

Currently, rwsf::XmlReader provides support only for reading elements and their content. No support for reading processing instructions, DOCTYPE declarations, or entity declarations is provided.

Note

rwsf::XmlReader converts all documents to UTF-8 regardless of the encoding of the source document.

Public Constructors

XmlReader(const char * buf,
    size_t length);
XmlReader(const unsigned char * buf,
    size_t length);
XmlReader();
XmlReader(const std::string & document);

Public Destructors

~XmlReader();

Public Member Functions

void
addNamespace(const rwsf::XmlNamespace & ns);
bool
eof();
rwsf::XmlReader
getElementReader(const rwsf::XmlReaderName & name = rwsf::XmlReaderName::Empty);
std::string
getEncoding() const;
bool
getExpandAttributeReference() const;
bool
getExpandCommentReference() const;
bool
getExpandContentReference() const;
rwsf::XmlAttributeSet
getLastAttributes() const;
std::string
getLastContent() const;
rwsf::XmlName
getLastName() const;
NodeType
getLastNodeType() const;
std::string
getPrefixForURI(const std::string & uri) const;
std::string
getStandalone() const;
std::string
getURIForPrefix(const std::string & prefix) const;
std::string
getVersion() const;
bool
hasEncoding() const;
bool
hasStandalone() const;
bool
isElementNext(const rwsf::XmlName & name);
bool
isElementNext(const std::string & name);
std::string
readElement(const rwsf::XmlName & name = NullName);
std::string
readElement(const std::string & name);
void
readElementEnd(const rwsf::XmlName & name);
void
readElementEnd();
rwsf::XmlAttributeSet
readElementStart(const rwsf::XmlName & name);
void
readElementStart();
std::string
readElementValue();
void
readNextNode();
std::string
readWellFormedElement(const rwsf::XmlName & name = NullName);
void
setExpandAttributeReference(bool expandReference);
void
setExpandCommentReference(bool expandComment);
void
setExpandContentReference(bool expandReference);

Protected Member Functions

rwsf::XmlReaderImp &
body() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.