Does not inherit
compareTo() empty() getEmptyNamespace() getPrefix() |
getURI() getXmlns() getXsd() getXsi() |
isNull() operator=() setPrefix() setURI() |
XmlNamespace() ~XmlNamespace() |
#include rwsf/core/XmlNamespace.h
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.
XmlNamespace();
Constructor. Constructs an empty namespace.
XmlNamespace(const std::string & prefix, const std::string & URI);
Constructs an object representing the namespace URI with the prefix prefix.
XmlNamespace(const XmlNamespace &);
Copy constructor. Constructs a deep copy.
~XmlNamespace();
Destructor.
const XmlNamespace & getEmptyNamespace();
Returns a namespace that has no prefix and no URI.
const XmlNamespace & getXmlns();
Returns a namespace with the prefix "xmlns" and the URI "", as specified by the W3C.
XmlNamespace & getXsd();
Returns a namespace equivalent to the xsd namespace, defined by the W3C as the prefix xsd mapped to the URI http://www.w3.org/2000/10/XMLSchema.
XmlNamespace & getXsi();
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/XMLSchema-instance/.
int compareTo(const XmlNamespace & other) const;
Returns the results of comparing of self's URI string to other's URI string using std::string::compare().
bool empty() const;
Returns true if this object is null (i.e., has a blank URI and prefix).
const std::string & getPrefix() const;
Returns the prefix for this namespace.
const std::string & getURI() const;
Returns the URI for this namespace.
bool isNull() const;
Return true if this object is null (i.e., has a blank local name and a null namespace).
void setPrefix(const std::string & pfx);
Sets the prefix of this namespace to pfx.
void setURI(const std::string & uri);
Sets the URI of this namespace to uri.
XmlNamespace & operator=(const XmlNamespace &);
Assignment operator. Makes self a deep copy.
© 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.