Qt 4.8
|
Creates an xs:QName
value from a lexical QName using statically known namespace bindings.
More...
#include <qqnameconstructor_p.h>
Static Public Functions | |
template<typename TReportContext , const ReportContext::ErrorCode InvalidQName, const ReportContext::ErrorCode NoBinding> | |
static QXmlName | expandQName (const QString &lexicalQName, const TReportContext &context, const NamespaceResolver::Ptr &nsResolver, const SourceLocationReflection *const r, const bool asForAttribute=false) |
static QXmlName::NamespaceCode | namespaceForPrefix (const QXmlName::PrefixCode prefix, const StaticContext::Ptr &context, const SourceLocationReflection *const r) |
Static Public Functions inherited from QPatternist::Expression | |
static void | rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context) |
Properties | |
const NamespaceResolver::Ptr | m_nsResolver |
Creates an xs:QName
value from a lexical QName using statically known namespace bindings.
Definition at line 75 of file qqnameconstructor_p.h.
QNameConstructor::QNameConstructor | ( | const Expression::Ptr & | source, |
const NamespaceResolver::Ptr & | nsResolver | ||
) |
Definition at line 52 of file qqnameconstructor.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 104 of file qqnameconstructor.cpp.
|
virtual |
Returns this
.
Reimplemented from QPatternist::Expression.
Definition at line 109 of file qqnameconstructor.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 59 of file qqnameconstructor.cpp.
|
static |
Expands lexicalQName
, which is a lexical representation of a QName such as "x:body", into a QName using nsResolver
to supply the namespace bindings.
If lexicalQName
is lexically invalid InvalidQName
is raised via context
, or if no namespace binding does not exists for a prefix(if any) in lexicalQName
, NoBinding
is raised via context
.
If asForAttribute
is true
, the name is considered to be for an attribute in some way, and lexicalQName
will not pick up the default namespace if it doesn't have a prefix.
nsResolver
is parameterized meaning the function can be instantiated with either DynamicContext or StaticContext.
Definition at line 137 of file qqnameconstructor_p.h.
Referenced by QPatternist::CastAs::castToQName(), QPatternist::ElementAvailableFN::evaluateEBV(), QPatternist::SystemPropertyFN::evaluateSingleton(), QPatternist::FunctionAvailableFN::evaluateSingleton(), QPatternist::TypeAvailableFN::evaluateSingleton(), evaluateSingleton(), QPatternist::ResolveQNameFN::evaluateSingleton(), and QPatternist::yyparse().
|
virtual |
Returns a list of Sequence Types, describing the type of each of the expression's operands. Hence, this function has a relationship to the operands() function:
- The lengths of the lists returned by expectedOperandTypes() and operands() should always be equal in length, since one cannot describe the type of a non-existent operand(and all operands must have type information). - A significant difference between the two functions is that while the type of objects in the list returned by operands() may vary between compilations/static context, simply because the particular Expression is part of different XPath expressions, the types in the list returned by expectedOperandTypes is always the same since the function/operator signature never changes.
This function should not be confused with staticType(), which returns the static type of the expression itself, not its operands. The function call is an expression where this is clear: the type of the return value is not the same as the arguments' types. The static type of the operands supplied to the expression can be determined via the staticType() function of the instances returned by operands().
If the expression has no operands, an empty list should be returned.
Implements QPatternist::Expression.
Definition at line 97 of file qqnameconstructor.cpp.
|
static |
Resolves the namespace prefix prefix
to its namespace if it exists, or raised ReportContext::XPST0081 otherwise.
prefix
Definition at line 73 of file qqnameconstructor.cpp.
Referenced by QPatternist::yyparse().
|
virtual |
Implements QPatternist::Expression.
Definition at line 92 of file qqnameconstructor.cpp.
|
private |
Definition at line 131 of file qqnameconstructor_p.h.
Referenced by evaluateSingleton(), and QNameConstructor().