Xalan-C++ API Reference  1.12.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
xalanc::XalanQName Class Referenceabstract

Class to represent a qualified name. More...

#include <xalanc/XPath/XalanQName.hpp>

Inheritance diagram for xalanc::XalanQName:
[legend]
Collaboration diagram for xalanc::XalanQName:
[legend]

Classes

class  InvalidQNameException
 
class  PrefixResolverProxy
 

Public Types

typedef XalanDeque< NameSpace, ConstructWithMemoryManagerTraits< NameSpace > > NamespaceVectorType
 
typedef XalanDeque< NamespaceVectorType, ConstructWithMemoryManagerTraits< NamespaceVectorType > > NamespacesStackType
 

Public Member Functions

 XalanQName ()
 Construct an empty XalanQName. More...
 
virtual ~XalanQName ()
 
 XalanQName (const XalanQName &)
 
virtual const XalanDOMStringgetLocalPart () const =0
 Retrieve the local part of qualified name. More...
 
virtual const XalanDOMStringgetNamespace () const =0
 Retrieve the namespace of qualified name. More...
 
bool isValid () const
 Determine if the qualified name is valid. More...
 
bool isEmpty () const
 Whether the qualified name is empty. More...
 
bool equals (const XalanQName &theRHS) const
 Override equals and agree that we're equal if the passed object is a string and it matches the name of the arg. More...
 
XalanDOMStringformat (XalanDOMString &theString) const
 Format the QName using the notation "{namespace-uri}local-part" or "local-part" if the namespace URI is empty. More...
 
size_t hash () const
 

Static Public Member Functions

static const XalanDOMStringgetNamespaceForPrefix (const NamespaceVectorType &namespaces, const XalanDOMString &prefix)
 Get the namespace for a prefix by searching a vector of namespaces. More...
 
static const XalanDOMStringgetNamespaceForPrefix (const NamespacesStackType &nsStack, const XalanDOMString &prefix)
 Get the namespace for a prefix by searching a stack of namespace vectors. More...
 
static const XalanDOMStringgetNamespaceForPrefix (const NamespacesStackType &nsStack, const XalanDOMChar *prefix)
 
static const XalanDOMStringgetNamespaceForPrefix (NamespacesStackType::const_iterator theBegin, NamespacesStackType::const_iterator theEnd, const XalanDOMString &prefix)
 Get the namespace for a prefix by searching a range of iterators. More...
 
static const XalanDOMStringgetPrefixForNamespace (const NamespaceVectorType &namespaces, const XalanDOMString &uri)
 Get the prefix for a namespace by searching a vector of namespaces. More...
 
static const XalanDOMStringgetNamespaceForPrefix (const NamespaceVectorType &namespaces, const XalanDOMChar *prefix)
 
static const XalanDOMStringgetPrefixForNamespace (const NamespacesStackType &nsStack, const XalanDOMString &uri)
 Get the prefix for a namespace by searching a stack of namespace vectors. More...
 
static const XalanDOMStringgetPrefixForNamespace (NamespacesStackType::const_iterator theBegin, NamespacesStackType::const_iterator theEnd, const XalanDOMString &uri)
 Get the prefix for a namespace by searching a range of iterators. More...
 
static const XalanDOMStringgetNamespaceForPrefix (NamespacesStackType::const_iterator theBegin, NamespacesStackType::const_iterator theEnd, const XalanDOMChar *prefix)
 
static bool isValidNCName (const XalanDOMString &theNCName)
 Determine if the string supplied satisfies the grammar for an XML NCName. More...
 
static bool isValidNCName (const XalanDOMChar *theNCName, XalanDOMString::size_type theLength=XalanDOMString::npos)
 Determine if the string supplied satisfies the grammar for an XML NCName. More...
 
static bool isValidQName (const XalanDOMString &theQName)
 Determine if the string supplied satisfies the grammar for an XML QName. More...
 
static bool isValidQName (const XalanDOMChar *theQName, XalanDOMString::size_type theLength=XalanDOMString::npos)
 Determine if the string supplied satisfies the grammar for an XML QName. More...
 

Static Protected Attributes

static const XalanDOMString s_emptyString
 

Detailed Description

Class to represent a qualified name.

The name of an internal XSLT object, specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]), an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]), a locale (see [14.3 Number Formatting]), a variable or a parameter (see [12 Variables and Parameters]) is specified as a QName. If it has a prefix, then the prefix is expanded into a URI reference using the namespace declarations in effect on the attribute in which the name occurs. The expanded name consisting of the local part of the name and the possibly null URI reference is used as the name of the object. The default namespace is not used for unprefixed names.

Definition at line 70 of file XalanQName.hpp.

Member Typedef Documentation

◆ NamespacesStackType

Definition at line 77 of file XalanQName.hpp.

◆ NamespaceVectorType

Definition at line 75 of file XalanQName.hpp.

Constructor & Destructor Documentation

◆ XalanQName() [1/2]

xalanc::XalanQName::XalanQName ( )
inlineexplicit

Construct an empty XalanQName.

Definition at line 84 of file XalanQName.hpp.

◆ ~XalanQName()

virtual xalanc::XalanQName::~XalanQName ( )
inlinevirtual

Definition at line 89 of file XalanQName.hpp.

◆ XalanQName() [2/2]

xalanc::XalanQName::XalanQName ( const XalanQName )
inline

Definition at line 93 of file XalanQName.hpp.

Member Function Documentation

◆ equals()

bool xalanc::XalanQName::equals ( const XalanQName theRHS) const
inline

Override equals and agree that we're equal if the passed object is a string and it matches the name of the arg.

Parameters
theRHSnamespace to compare
Returns
true if namespace and local part are both empty

Definition at line 143 of file XalanQName.hpp.

References getLocalPart(), and getNamespace().

Referenced by xalanc::operator==().

◆ format()

XalanDOMString& xalanc::XalanQName::format ( XalanDOMString theString) const

Format the QName using the notation "{namespace-uri}local-part" or "local-part" if the namespace URI is empty.

The result is appended to the provided string.

Parameters
theStringThe string to format with the
Returns
A reference to the parameter.

◆ getLocalPart()

virtual const XalanDOMString& xalanc::XalanQName::getLocalPart ( ) const
pure virtual

Retrieve the local part of qualified name.

Returns
local part string

Implemented in xalanc::XalanQNameByValue, and xalanc::XalanQNameByReference.

Referenced by equals(), xalanc::operator<(), and xalanc::XalanQNameByValue::operator=().

◆ getNamespace()

virtual const XalanDOMString& xalanc::XalanQName::getNamespace ( ) const
pure virtual

Retrieve the namespace of qualified name.

Returns
namespace string

Implemented in xalanc::XalanQNameByValue, and xalanc::XalanQNameByReference.

Referenced by equals(), xalanc::operator<(), and xalanc::XalanQNameByValue::operator=().

◆ getNamespaceForPrefix() [1/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( const NamespacesStackType nsStack,
const XalanDOMChar *  prefix 
)
static

◆ getNamespaceForPrefix() [2/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( const NamespacesStackType nsStack,
const XalanDOMString prefix 
)
static

Get the namespace for a prefix by searching a stack of namespace vectors.

Parameters
nsStackstack of namespace vectors to search
prefixnamespace prefix to find
Returns
pointer to the string value if found, otherwise null.

◆ getNamespaceForPrefix() [3/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( const NamespaceVectorType namespaces,
const XalanDOMChar *  prefix 
)
static

◆ getNamespaceForPrefix() [4/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( const NamespaceVectorType namespaces,
const XalanDOMString prefix 
)
static

Get the namespace for a prefix by searching a vector of namespaces.

Parameters
namespacesvector of namespaces to search
prefixnamespace prefix to find
Returns
pointer to the string value if found, otherwise null.

◆ getNamespaceForPrefix() [5/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( NamespacesStackType::const_iterator  theBegin,
NamespacesStackType::const_iterator  theEnd,
const XalanDOMChar *  prefix 
)
static

◆ getNamespaceForPrefix() [6/6]

static const XalanDOMString* xalanc::XalanQName::getNamespaceForPrefix ( NamespacesStackType::const_iterator  theBegin,
NamespacesStackType::const_iterator  theEnd,
const XalanDOMString prefix 
)
static

Get the namespace for a prefix by searching a range of iterators.

The search is done in reverse, from the end of the range to the beginning.

Parameters
theBeginThe beginning iterator for the range
theBeginThe ending iterator for the range
prefixnamespace prefix to find
Returns
pointer to the string value if found, otherwise null.

◆ getPrefixForNamespace() [1/3]

static const XalanDOMString* xalanc::XalanQName::getPrefixForNamespace ( const NamespacesStackType nsStack,
const XalanDOMString uri 
)
static

Get the prefix for a namespace by searching a stack of namespace vectors.

Parameters
nsStackstack of namespace vectors to search
uriURI string for namespace to find
Returns
pointer to the string value if found, otherwise null.

◆ getPrefixForNamespace() [2/3]

static const XalanDOMString* xalanc::XalanQName::getPrefixForNamespace ( const NamespaceVectorType namespaces,
const XalanDOMString uri 
)
static

Get the prefix for a namespace by searching a vector of namespaces.

Parameters
namespacesvector of namespaces to search
uriURI string for namespace to find
reversetrue to search vector from last to first, default true
Returns
pointer to the string value if found, otherwise null.

◆ getPrefixForNamespace() [3/3]

static const XalanDOMString* xalanc::XalanQName::getPrefixForNamespace ( NamespacesStackType::const_iterator  theBegin,
NamespacesStackType::const_iterator  theEnd,
const XalanDOMString uri 
)
static

Get the prefix for a namespace by searching a range of iterators.

The search is done in reverse, from the end of the range to the beginning.

Parameters
theBeginThe beginning iterator for the range to search
theBeginThe ending iterator for the range to search
uriURI string for namespace to find
Returns
pointer to the string value if found, otherwise null.

◆ hash()

size_t xalanc::XalanQName::hash ( ) const
inline

Definition at line 163 of file XalanQName.hpp.

◆ isEmpty()

bool xalanc::XalanQName::isEmpty ( ) const
inline

Whether the qualified name is empty.

Returns
true if namespace and local part are both empty

Definition at line 130 of file XalanQName.hpp.

◆ isValid()

bool xalanc::XalanQName::isValid ( ) const
inline

Determine if the qualified name is valid.

Returns
true if the instance is a valid QName, false if not.

Definition at line 119 of file XalanQName.hpp.

◆ isValidNCName() [1/2]

static bool xalanc::XalanQName::isValidNCName ( const XalanDOMChar *  theNCName,
XalanDOMString::size_type  theLength = XalanDOMString::npos 
)
static

Determine if the string supplied satisfies the grammar for an XML NCName.

Parameters
theNCNameThe string to check
theLengthThe length of the string
Returns
bool true if the string is a valid NCName, false if not

◆ isValidNCName() [2/2]

static bool xalanc::XalanQName::isValidNCName ( const XalanDOMString theNCName)
static

Determine if the string supplied satisfies the grammar for an XML NCName.

Parameters
theNCNameThe string to check
Returns
bool true if the string is a valid NCName, false if not.

◆ isValidQName() [1/2]

static bool xalanc::XalanQName::isValidQName ( const XalanDOMChar *  theQName,
XalanDOMString::size_type  theLength = XalanDOMString::npos 
)
static

Determine if the string supplied satisfies the grammar for an XML QName.

Note that this function does not determine if any supplied prefix is bound to a namespace URI

Parameters
theQNameThe string to check
theLengthThe length of the string
Returns
bool true if the string is a valid QName, false if not

◆ isValidQName() [2/2]

static bool xalanc::XalanQName::isValidQName ( const XalanDOMString theQName)
static

Determine if the string supplied satisfies the grammar for an XML QName.

Note that this function does not determine if any supplied prefix is bound to a namespace URI

Parameters
theQNameThe string to check
Returns
bool true if the string is a valid QName, false if not

Member Data Documentation

◆ s_emptyString

const XalanDOMString xalanc::XalanQName::s_emptyString
staticprotected

Definition at line 393 of file XalanQName.hpp.


The documentation for this class was generated from the following file: