HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Related Functions
rwsf::XmlNamespace Class Reference

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 &copy)
 
int compareTo (const XmlNamespace &other) const
 
bool empty () const
 
const std::string & getPrefix () const
 
const std::string & getURI () const
 
bool isNull () const
 
XmlNamespaceoperator= (const XmlNamespace &copy)
 
void setPrefix (const std::string &pfx)
 
void setURI (const std::string &uri)
 

Static Public Member Functions

static const XmlNamespacegetEmptyNamespace ()
 
static const XmlNamespacegetXmlns ()
 
static const XmlNamespacegetXsd ()
 
static const XmlNamespacegetXsi ()
 

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)
 

Detailed Description

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.

Note
The URIs returned by this class match specific versions of the SOAP and XML Schema recommendations. Previous and subsequent versions of the specifications contain different URIs.

Constructor & Destructor Documentation

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.

Member Function Documentation

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 const 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 const 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.

Friends And Related Function Documentation

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 © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.