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

rwsf::XmlName

Group:  Core XML


Does not inherit

Local Index

Members

Header File

#include rwsf/core/XmlName.h

Description

The complete information for an XML name consists of a local name and its namespace. rwsf::XmlName represents a complete XML name using a local name represented as a string and an rwsf::XmlNamespace. If the local name has no namespace qualification, the namespace component of an instance of this class will be a namespace equal to the namespace returned by rwsf::XmlNamespace::getEmptyNamespace().

For the element

the rwsf::XmlName contains the local name book and an rwsf::XmlNamespace object that contains the prefix string "rw" and the URI string "http://xml.roguewave.com/". The combination of the prefix and the local name is the qualified name, rw:book in this example.

Every XML element must have a name. All classes that represent XML elements contain an rwsf::XmlName. However, HydraAgent allows an rwsf::XmlName to contain the empty string as a local name. An empty local name cannot be represented as valid XML. For objects with an empty local name, a serializer is free to provide an arbitrary name.

rwsf::XmlName does not represent the context of the name. An instance of this class contains no information about relationships among the namespace where the element resides and other namespace declarations in a document. The W3C specifies that the prefix of an XML name is an arbitrary placeholder for the URI. Therefore, a serializer for an rwsf::XmlName may not generate the same qualified name as the object itself. A serializer must preserve the unique name, but is free to replace the prefix with an equivalent prefix, generate a new prefix, or ignore the prefix entirely.

Public Constructors

XmlName();
XmlName(const std::string & localName);
XmlName(const std::string & localName,
    const rwsf::XmlNamespace & ns);
XmlName(const XmlName & name);

Public Destructors

~XmlName();

Public Member Functions

std::string
asString() const;
int
compareTo(const XmlName & other) const;
bool
empty() const;
const std::string &
getLocalName() const;
const rwsf::XmlNamespace &
getNamespace() const;
rwsf::XmlNamespace &
getNamespace();
std::string
getQualifiedName() const;
std::string
getUniqueName() const;
bool
isNull() const;
void
setLocalName(const std::string & localName);
void
setNamespace(const rwsf::XmlNamespace & ns);
void
unsetNamespace();

Public Operators

XmlName &
operator=(const XmlName & n);


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.