HydraExpress 4.6 |
HydraExpress C++ API Reference Guide |
|
Represents an XML namespace, containing a prefix and a URI as instances of std::string. More...
#include <rwsf/core/XmlNamespace.h>
Public Member Functions | |
XmlNamespace () | |
XmlNamespace (const std::string &prefix, const std::string &URI) | |
XmlNamespace (const XmlNamespace ©) | |
XmlNamespace & | operator= (const XmlNamespace ©) |
void | setPrefix (const std::string &pfx) |
void | setURI (const std::string &uri) |
const std::string & | getPrefix () const |
const std::string & | getURI () const |
bool | empty () const |
bool | isNull () const |
int | compareTo (const XmlNamespace &other) const |
Static Public Member Functions | |
static const XmlNamespace & | getXmlns () |
static XmlNamespace & | getXsi () |
static XmlNamespace & | getXsd () |
static const XmlNamespace & | getEmptyNamespace () |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const XmlNamespace &lhs, const XmlNamespace &rhs) |
bool | operator!= (const XmlNamespace &lhs, const XmlNamespace &rhs) |
bool | operator< (const XmlNamespace &lhs, const XmlNamespace &rhs) |
Class rwsf::XmlNamespace encapsulates an XML namespace declaration. The class holds the prefix (namespace prefix) and the URI (namespace name) as instances of std::string.
For example, an rwsf::XmlNamespace object containing the prefix string "rw"
and the URI string "http://xml.roguewave.com/"
represents a namespace declaration serializable as xmlns:rw="http://xml.roguewave.com/"
.
rwsf::XmlNamespace treats the prefix as an arbitrary placeholder for the URI. Two namespaces with identical URI strings compare equal even if the namespaces have different prefixes.
The class also contains static convenience functions that return namespaces commonly used in XML documents. Each method is named according to the prefix conventionally used for the namespace that the method returns. The namespaces returned match namespaces in the 24 Oct 2000 draft of the W3C XML Schema recommendation and the SOAP 1.1 specification.
rwsf::XmlNamespace::XmlNamespace | ( | ) |
Constructs an XmlNamespace as an empty namespace (URI and prefix are blank).
rwsf::XmlNamespace::XmlNamespace | ( | const std::string & | prefix, | |
const std::string & | URI | |||
) |
Constructs an XmlNamespace representing the namespace URI with the prefix prefix.
rwsf::XmlNamespace::XmlNamespace | ( | const XmlNamespace & | copy | ) |
Constructs a deep copy of copy.
int rwsf::XmlNamespace::compareTo | ( | const XmlNamespace & | other | ) | const |
Returns the results of comparing self's URI string to the URI string of other, using std::string::compare().
bool rwsf::XmlNamespace::empty | ( | ) | const |
Returns true if this object is null (i.e., has a blank URI and prefix).
static const XmlNamespace& rwsf::XmlNamespace::getEmptyNamespace | ( | ) | [static] |
Returns a namespace that has no prefix and no URI.
const std::string& rwsf::XmlNamespace::getPrefix | ( | ) | const |
Returns the prefix for this namespace.
const std::string& rwsf::XmlNamespace::getURI | ( | ) | const |
Returns the URI for this namespace.
static const XmlNamespace& rwsf::XmlNamespace::getXmlns | ( | ) | [static] |
Returns a namespace with the prefix "xmlns"
and the URI ""
, as specified by the W3C.
static XmlNamespace& rwsf::XmlNamespace::getXsd | ( | ) | [static] |
Returns a namespace equivalent to the xsd
namespace, defined by the W3C as the prefix xsd
mapped to the URI http://www.w3.org/2001/XMLSchema.
static XmlNamespace& rwsf::XmlNamespace::getXsi | ( | ) | [static] |
Returns a namespace equivalent to the xsi
namespace, defined by the W3C as the prefix xsi
mapped to the URI http://www.w3.org/2000/10/XMLSchema-instance/.
bool rwsf::XmlNamespace::isNull | ( | ) | const |
Returns true if this object is null (i.e., has a blank URI and prefix).
XmlNamespace& rwsf::XmlNamespace::operator= | ( | const XmlNamespace & | copy | ) |
Assignment operator. Makes self a deep copy of copy.
void rwsf::XmlNamespace::setPrefix | ( | const std::string & | pfx | ) |
Sets the prefix of this namespace to pfx.
void rwsf::XmlNamespace::setURI | ( | const std::string & | uri | ) |
Sets the URI of this namespace to uri.
bool operator!= | ( | const XmlNamespace & | lhs, | |
const XmlNamespace & | rhs | |||
) | [related] |
Returns false
if lhs
and rhs
have identical URI strings as determined by a string comparison.
bool operator< | ( | const XmlNamespace & | lhs, | |
const XmlNamespace & | rhs | |||
) | [related] |
Returns true
if the URI string contained in lhs is less than the URI string contained in rhs, as determined by operator<
for std::string.
bool operator== | ( | const XmlNamespace & | lhs, | |
const XmlNamespace & | rhs | |||
) | [related] |
Returns true
if lhs and rhs have identical URI strings as determined by a string comparison.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.