46 #include "private/qxmlutils_p.h" 62 const QString prefix(prefixItem ? prefixItem.stringValue() :
QString());
65 const QString namespaceURI(namespaceItem ? namespaceItem.stringValue() :
QString());
67 if(namespaceURI.isEmpty())
69 context->
error(QtXmlPatterns::tr(
"In a namespace constructor, the value for a namespace cannot be an empty string."),
80 context->
error(QtXmlPatterns::tr(
"The prefix must be a valid %1, which %2 is not.")
86 const QXmlName binding(np->allocateBinding(prefix, namespaceURI));
88 AnyURI::toQUrl<ReportContext::XTDE0905, DynamicContext::Ptr>(namespaceURI,
94 context->error(QtXmlPatterns::tr(
"The prefix %1 cannot be bound.")
104 context->error(QtXmlPatterns::tr(
"Only the prefix %1 can be bound to %2 and vice versa.")
110 context->outputReceiver()->namespaceBinding(binding);
133 return visitor->visit(
this);
virtual NamePool::Ptr namePool() const =0
#define QT_END_NAMESPACE
This macro expands to.
QString formatKeyword(const QString &keyword)
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
ComputedNamespaceConstructor(const Expression::Ptr &prefix, const Expression::Ptr &namespaceURI)
The QString class provides a Unicode character string.
virtual SequenceType::List expectedOperandTypes() const
static const SequenceType::Ptr ZeroOrOneString
virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const
void append(const T &t)
Inserts value at the end of the list.
static const SequenceType::Ptr ExactlyOneAttribute
#define QT_BEGIN_NAMESPACE
This macro expands to.
void error(const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
The namespace for the internal API of QtXmlPatterns.
virtual SequenceType::Ptr staticType() const
virtual void evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Contains functions used for formatting arguments, such as keywords and paths, in translated strings...
Represents an item in the XPath 2.0 Data Model.
Expression::Ptr m_operand1
static const AtomicType::Ptr xsNCName
virtual Expression::Properties properties() const
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
Expression::Ptr m_operand2
static bool isNCName(const QStringRef &ncName)
Determines whether c is a valid instance of production [4]NCName in the XML 1.0 Namespaces specificat...
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const
The QList class is a template class that provides lists.
Base class for expressions that has exactly two operands.