Qt 4.8
Public Functions | Static Private Functions | Properties | List of all members
QPatternist::ElementAvailableFN Class Reference

Implements the function fn:unparsed-text(). More...

#include <qelementavailablefn_p.h>

Inheritance diagram for QPatternist::ElementAvailableFN:
QPatternist::StaticNamespacesContainer QPatternist::FunctionCall QPatternist::UnlimitedContainer QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection

Public Functions

 ElementAvailableFN ()
 
virtual bool evaluateEBV (const DynamicContext::Ptr &context) const
 
- Public Functions inherited from QPatternist::StaticNamespacesContainer
virtual Expression::Ptr typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
 
- Public Functions inherited from QPatternist::FunctionCall
virtual ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const
 
virtual SequenceType::List expectedOperandTypes () const
 
virtual ID id () const
 
virtual Expression::Properties properties () const
 
virtual void setSignature (const FunctionSignature::Ptr &sign)
 
virtual FunctionSignature::Ptr signature () const
 
virtual SequenceType::Ptr staticType () const
 
- Public Functions inherited from QPatternist::UnlimitedContainer
virtual bool compressOperands (const StaticContext::Ptr &)
 
virtual Expression::List operands () const
 
virtual void setOperands (const Expression::List &list)
 
 UnlimitedContainer (const Expression::List &operands=Expression::List())
 
- Public Functions inherited from QPatternist::Expression
virtual const SourceLocationReflectionactualReflection () const
 Returns this. More...
 
virtual void announceFocusType (const ItemType::Ptr &itemType)
 
virtual Expression::Ptr compress (const StaticContext::Ptr &context)
 
Properties deepProperties () const
 Computes the union of properties for this Expression and all its descending children. More...
 
virtual Properties dependencies () const
 
virtual QString description () const
 
virtual Item::Iterator::Ptr evaluateSequence (const DynamicContext::Ptr &context) const
 
virtual Item evaluateSingleton (const DynamicContext::Ptr &context) const
 
virtual void evaluateToSequenceReceiver (const DynamicContext::Ptr &context) const
 
virtual ItemType::Ptr expectedContextItemType () const
 
 Expression ()
 
bool has (const Property prop) const
 
bool hasDependency (const Property prop) const
 
bool is (const ID id) const
 
bool isEvaluated () const
 
virtual ItemType::Ptr newFocusType () const
 
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > optimizationPasses () const
 
virtual PatternPriority patternPriority () const
 
const Expression::Ptrrewrite (const Expression::Ptr &to, const StaticContext::Ptr &context) const
 Rewrites this Expression to to, and return to. More...
 
virtual ~Expression ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 
- Public Functions inherited from QPatternist::CppCastingHelper< Expression >
const TCastTarget * as () const
 
TCastTarget * as ()
 
- Public Functions inherited from QPatternist::SourceLocationReflection
virtual QSourceLocation sourceLocation () const
 
 SourceLocationReflection ()
 
virtual ~SourceLocationReflection ()
 

Static Private Functions

static QSet< QStringallXSLTInstructions ()
 

Properties

const QSet< QStringm_xsltInstructions
 

Additional Inherited Members

- Public Types inherited from QPatternist::FunctionCall
typedef QExplicitlySharedDataPointer< FunctionCallPtr
 
- Public Types inherited from QPatternist::UnlimitedContainer
enum  CardinalityComputation { ProductOfCardinality, UnionOfCardinality }
 
- Public Types inherited from QPatternist::Expression
typedef QExplicitlySharedDataPointer< const ExpressionConstPtr
 A smart pointer wrapping const Expression instances. More...
 
enum  ID {
  IDBooleanValue = 1, IDCountFN, IDEmptyFN, IDExistsFN,
  IDExpressionSequence, IDGeneralComparison, IDIfThenClause, IDIgnorableExpression,
  IDIntegerValue, IDPositionFN, IDStringValue, IDValueComparison,
  IDRangeVariableReference, IDContextItem, IDUserFunctionCallsite, IDExpressionVariableReference,
  IDAttributeConstructor, IDUpperCaseFN, IDLowerCaseFN, IDFirstItemPredicate,
  IDEmptySequence, IDReturnOrderBy, IDLetClause, IDForClause,
  IDPath, IDNamespaceConstructor, IDArgumentReference, IDGenericPredicate,
  IDAxisStep, IDFloat, IDCombineNodes, IDUnresolvedVariableReference,
  IDCardinalityVerifier
}
 
typedef QList< Expression::PtrList
 
typedef QFlags< PropertyProperties
 
enum  Property {
  UseContextItem = 1, DisableElimination = 1 << 1, IsEvaluated = 1 << 2, DisableTypingDeduction = 1 << 3,
  EmptynessFollowsChild = 1 << 4, RewriteToEmptyOnEmpty = 1 << 5, RequiresFocus = 1 << 6, AffectsOrderOnly = 1 << 7,
  RequiresContextItem = (1 << 8) | RequiresFocus, CreatesFocusForLast = 1 << 9, LastOperandIsCollation = 1 << 10, DependsOnLocalVariable = (1 << 11) | DisableElimination,
  EvaluationCacheRedundant = (1 << 12), IsNodeConstructor = 1 << 13, RequiresCurrentItem = 1 << 14
}
 
typedef QExplicitlySharedDataPointer< ExpressionPtr
 A smart pointer wrapping mutable Expression instances. More...
 
typedef ::QAbstractXmlForwardIterator< Expression::PtrQAbstractXmlForwardIterator
 
typedef QVector< Expression::PtrVector
 
- Static Public Functions inherited from QPatternist::Expression
static void rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::StaticNamespacesContainer
const NamespaceResolver::PtrstaticNamespaces () const
 
 StaticNamespacesContainer ()
 
- Protected Functions inherited from QPatternist::UnlimitedContainer
template<CardinalityComputation suppliedCard>
SequenceType::Ptr operandsUnionType () const
 
- Protected Functions inherited from QPatternist::Expression
void typeCheckOperands (const StaticContext::Ptr &context)
 
- Protected Functions inherited from QPatternist::CppCastingHelper< Expression >
 CppCastingHelper ()
 
- Protected Variables inherited from QPatternist::UnlimitedContainer
Expression::List m_operands
 

Detailed Description

Implements the function fn:unparsed-text().

See also
XSL Transformations (XSLT) Version 2.0, 16.2 unparsed-text
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com
Since
4.5

Definition at line 71 of file qelementavailablefn_p.h.

Constructors and Destructors

◆ ElementAvailableFN()

ElementAvailableFN::ElementAvailableFN ( )

Definition at line 50 of file qelementavailablefn.cpp.

51 {
52 }
const QSet< QString > m_xsltInstructions
static QSet< QString > allXSLTInstructions()

Functions

◆ allXSLTInstructions()

QSet< QString > ElementAvailableFN::allXSLTInstructions ( )
staticprivate

Definition at line 54 of file qelementavailablefn.cpp.

55 {
56  enum
57  {
58  StringSetSize = 27
59  };
60 
61  QSet<QString> retval;
62  retval.reserve(StringSetSize);
63 
64  /* Alphabetically. */
65  retval.insert(QLatin1String("analyze-string"));
66  retval.insert(QLatin1String("apply-imports"));
67  retval.insert(QLatin1String("apply-templates"));
68  retval.insert(QLatin1String("attribute"));
69  retval.insert(QLatin1String("attribute-set"));
70  retval.insert(QLatin1String("call-template"));
71  retval.insert(QLatin1String("character-map"));
72  retval.insert(QLatin1String("choose"));
73  retval.insert(QLatin1String("comment"));
74  retval.insert(QLatin1String("copy"));
75  retval.insert(QLatin1String("copy-of"));
76  retval.insert(QLatin1String("document"));
77  retval.insert(QLatin1String("element"));
78  retval.insert(QLatin1String("fallback"));
79  retval.insert(QLatin1String("for-each"));
80  retval.insert(QLatin1String("for-each-group"));
81  retval.insert(QLatin1String("if"));
82  retval.insert(QLatin1String("message"));
83  retval.insert(QLatin1String("namespace"));
84  retval.insert(QLatin1String("next-match"));
85  retval.insert(QLatin1String("number"));
86  retval.insert(QLatin1String("perform-sort"));
87  retval.insert(QLatin1String("processing-instruction"));
88  retval.insert(QLatin1String("result-document"));
89  retval.insert(QLatin1String("sequence"));
90  retval.insert(QLatin1String("text"));
91  retval.insert(QLatin1String("variable"));
92 
93  Q_ASSERT(retval.count() == StringSetSize);
94  return retval;
95 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const_iterator insert(const T &value)
Definition: qset.h:179
int count() const
Definition: qset.h:178
void reserve(int size)
Definition: qset.h:241

◆ evaluateEBV()

bool ElementAvailableFN::evaluateEBV ( const DynamicContext::Ptr context) const
virtual

Determines the Effective Boolean Value of the expression.

The Effective Boolean Value of a value is not necessarily the same as converting the value to a new value of type xs:boolean.

Note that this function cannot return the empty sequence, evaluateSingleton() must be overridden in order to be able to do that.

The default implementation results in a type error. Hence, this function must be overridden if such behavior is not of interest.

See also
XML Path Language (XPath) 2.0, 2.4.3 Effective Boolean Value

Reimplemented from QPatternist::Expression.

Definition at line 97 of file qelementavailablefn.cpp.

98 {
99  const Item arg(m_operands.first()->evaluateSingleton(context));
100  const QString stringName(arg.stringValue());
101 
104  ReportContext::XTDE1440>(stringName,
105  context,
107  this,
108  false));
109 
110  if(elementName.namespaceURI() != StandardNamespaces::xslt)
111  return false;
112 
113  QString prefix;
114  QString localName;
115  XPathHelper::splitQName(stringName, prefix, localName);
116 
117  return m_xsltInstructions.contains(localName);
118 }
const NamespaceResolver::Ptr & staticNamespaces() const
static QXmlName expandQName(const QString &lexicalQName, const TReportContext &context, const NamespaceResolver::Ptr &nsResolver, const SourceLocationReflection *const r, const bool asForAttribute=false)
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool contains(const T &value) const
Definition: qset.h:91
const QSet< QString > m_xsltInstructions
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
Represents an item in the XPath 2.0 Data Model.
Definition: qitem_p.h:182
static void splitQName(const QString &qName, QString &prefix, QString &localName)
Splits qName into localName and prefix.
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const

Properties

◆ m_xsltInstructions

const QSet<QString> QPatternist::ElementAvailableFN::m_xsltInstructions
private

Definition at line 79 of file qelementavailablefn_p.h.

Referenced by evaluateEBV().


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