Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Hydra Core Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::XmlName

Group:  XML Related

Local Index

Members

Non-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, Hydra 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.

Related Classes

rwsf::XmlNamespace

Public Constructors

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

Public Destructor

~XmlName();

Public Member Operator

XmlName&
operator=(const XmlName& n);

Global Logical Operators

bool
operator==(const XmlName&,
            const XmlName&);
bool
operator!=(const XmlName& lhs,
            const XmlName& rhs);
bool
operator<(const XmlName&,
             const XmlName&);

Public Member Functions

std::string
asString() const;
int
compareTo(const XmlName& other) const;
const std::string&
getLocalName() const;
rwsf::XmlNamespace&
getNamespace();
const rwsf::XmlNamespace&
getNamespace() const;
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();


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.