HydraExpress™ C++ 2019 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
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 ©) | |
int | compareTo (const XmlNamespace &other) const |
bool | empty () const |
const std::string & | getPrefix () const |
const std::string & | getURI () const |
bool | isNull () const |
XmlNamespace & | operator= (const XmlNamespace ©) |
void | setPrefix (const std::string &pfx) |
void | setURI (const std::string &uri) |
Static Public Member Functions | |
static const XmlNamespace & | getEmptyNamespace () |
static const XmlNamespace & | getXmlns () |
static const XmlNamespace & | getXsd () |
static const XmlNamespace & | getXsi () |
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 |
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 |
Returns a namespace with the prefix "xmlns"
and the URI ""
, as specified by the W3C.
|
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 |
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.
|
related |
Returns false
if lhs
and rhs
have identical URI strings as determined by a string comparison.
|
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.
|
related |
Returns true
if lhs and rhs have identical URI strings as determined by a string comparison.
Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved. |