本文整理汇总了C++中staticcontext::Ptr::namespaceBindings方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::namespaceBindings方法的具体用法?C++ Ptr::namespaceBindings怎么用?C++ Ptr::namespaceBindings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类staticcontext::Ptr
的用法示例。
在下文中一共展示了Ptr::namespaceBindings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typeCheck
Expression::Ptr ElementConstructor::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
/* What does this code do? When type checking our children, our namespace
* bindings, which are also children of the form of NamespaceConstructor
* instances, must be statically in-scope for them, so find them and
* shuffle their bindings into the StaticContext. */
m_staticBaseURI = context->baseURI();
/* Namespace declarations changes the in-scope bindings, so let's
* first lookup our child NamespaceConstructors. */
const ID operandID = m_operand2->id();
NamespaceResolver::Bindings overrides;
if(operandID == IDExpressionSequence)
{
const Expression::List operands(m_operand2->operands());
const int len = operands.count();
for(int i = 0; i < len; ++i)
{
if(operands.at(i)->is(IDNamespaceConstructor))
{
const QXmlName &nb = operands.at(i)->as<NamespaceConstructor>()->namespaceBinding();
overrides.insert(nb.prefix(), nb.namespaceURI());
}
}
}
const NamespaceResolver::Ptr newResolver(new DelegatingNamespaceResolver(context->namespaceBindings(), overrides));
const StaticContext::Ptr augmented(new StaticNamespaceContext(newResolver, context));
return PairContainer::typeCheck(augmented, reqType);
}
示例2: staticContext
ParserContext::ParserContext(const StaticContext::Ptr &context,
const QXmlQuery::QueryLanguage lang,
Tokenizer *const tokener) : staticContext(context)
, tokenizer(tokener)
, languageAccent(lang)
, nodeTestSource(BuiltinTypes::element)
, moduleNamespace(StandardNamespaces::empty)
, isPreviousEnclosedExpr(false)
, elementConstructorDepth(0)
, hasSecondPrologPart(false)
, preserveNamespacesMode(true)
, inheritNamespacesMode(true)
, isParsingPattern(false)
, currentImportPrecedence(1)
, m_evaluationCacheSlot(-1)
, m_expressionSlot(0)
, m_positionSlot(-1)
, m_globalVariableSlot(-1)
, m_currentTemplateID(InitialTemplateID)
{
resolvers.push(context->namespaceBindings());
Q_ASSERT(tokenizer);
Q_ASSERT(context);
m_isParsingWithParam.push(false);
isBackwardsCompat.push(false);
}
示例3: typeCheck
Expression::Ptr ElementConstructor::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
m_staticBaseURI = context->baseURI();
/* Namespace declarations changes the in-scope bindings, so let's
* first lookup our child NamespaceConstructors. */
const ID operandID = m_operand2->id();
NamespaceResolver::Bindings overrides;
if(operandID == IDExpressionSequence)
{
const Expression::List operands(m_operand2->operands());
const int len = operands.count();
for(int i = 0; i < len; ++i)
{
if(operands.at(i)->is(IDNamespaceConstructor))
{
const QXmlName &nb = operands.at(i)->as<NamespaceConstructor>()->namespaceBinding();
overrides.insert(nb.prefix(), nb.namespaceURI());
}
}
}
const NamespaceResolver::Ptr newResolver(new DelegatingNamespaceResolver(context->namespaceBindings(), overrides));
const StaticContext::Ptr augmented(new StaticNamespaceContext(newResolver, context));
return PairContainer::typeCheck(augmented, reqType);
}
示例4: typeCheck
Expression::Ptr StaticNamespacesContainer::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
m_resolver = NamespaceResolver::Ptr(context->namespaceBindings());
Q_ASSERT(m_resolver);
return FunctionCall::typeCheck(context, reqType);
}
示例5: castToQName
Expression::Ptr CastAs::castToQName(const StaticContext::Ptr &context) const
{
/* Apply the whitespace facet by calling trimmed(). */
/* We can assume m_operand is an Expression because this is a requirement
* for casting to xs:QName. */
const QString lexQName(m_operand->as<Literal>()->item().as<AtomicValue>()->stringValue().trimmed());
const QXmlName
expName(QNameConstructor::expandQName<StaticContext::Ptr,
ReportContext::FORG0001,
ReportContext::FONS0004>(lexQName,
context,
context->namespaceBindings(), this));
return wrapLiteral(toItem(QNameValue::fromValue(context->namePool(), expName)), context, this);
}
示例6: namespaceForPrefix
QXmlName::NamespaceCode QNameConstructor::namespaceForPrefix(const QXmlName::PrefixCode prefix,
const StaticContext::Ptr &context,
const SourceLocationReflection *const r)
{
Q_ASSERT(context);
const QXmlName::NamespaceCode ns(context->namespaceBindings()->lookupNamespaceURI(prefix));
if(ns == NamespaceResolver::NoBinding)
{
context->error(QtXmlPatterns::tr("No namespace binding exists for the prefix %1")
.arg(formatKeyword(context->namePool()->stringForPrefix(prefix))),
ReportContext::XPST0081,
r);
return NamespaceResolver::NoBinding;
}
else
return ns;
}