43 #include <QStringList> 54 #include "private/qxmlutils_p.h" 69 return context.
second->elementById(context.
first->namePool()->allocateQName(
QString(),
id));
94 virtual QString current()
const;
107 , m_sourceAtEnd(false)
136 if(sourceNext.isNull())
144 const int count = candidates.length();
146 for(
int i = 0; i <
count; ++i)
171 const Item node(m_operands.last()->evaluateSingleton(context));
173 checkTargetNode(node.asNode(), context, ReportContext::FODC0001);
175 return makeItemMappingIterator<
Item,
180 qMakePair(context, node.asNode().model()));
186 if(m_hasCreatedSorter)
187 return FunctionCall::typeCheck(context, reqType);
192 m_hasCreatedSorter =
true;
193 return newMe->
typeCheck(context, reqType);
201 Item mId(ids->next());
203 return CommonValues::emptyIterator;
205 const Item node(m_operands.last()->evaluateSingleton(context));
206 checkTargetNode(node.asNode(), context, ReportContext::FODC0001);
208 return CommonValues::emptyIterator;
228 const Item itemURI(m_operands.first()->evaluateSingleton(context));
237 const QUrl mayRela(AnyURI::toQUrl<ReportContext::FODC0005>(itemURI.stringValue(), context,
this));
253 return CommonSequenceTypes::ZeroOrOneDocumentNode;
258 const Item itemURI(m_operands.first()->evaluateSingleton(context));
269 const QUrl mayRela(AnyURI::toQUrl<ReportContext::FODC0005>(itemURI.stringValue(), context,
this));
279 if(m_operands.isEmpty())
282 context->
error(QtXmlPatterns::tr(
"The default collection is undefined"),
283 ReportContext::FODC0002,
this);
284 return CommonValues::emptyIterator;
288 const Item itemURI(m_operands.first()->evaluateSingleton(context));
292 const QUrl uri(AnyURI::toQUrl<ReportContext::FODC0004>(itemURI.stringValue(), context,
this));
296 ReportContext::FODC0004,
this);
297 return CommonValues::emptyIterator;
302 return CommonValues::emptyIterator;
virtual bool isDocumentAvailable(const QUrl &uri)
Calls to this function are generated by calls to the fn:doc-available() function. ...
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
static QString formatResourcePath(const QUrl &uri)
Formats uri as a path to a resource, typically it's a filename or a URI.
StringSplitter(const Item::Iterator::Ptr &source)
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
static QUrl resolveScheme(const QUrl &url)
Attemps to resolve scheme if URL does not have scheme defined.
QUrl resolveURI(const QUrl &relative, const QUrl &baseURI) const
#define at(className, varName)
int length() const
Returns the number of characters in this string.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
bool exists() const
Returns true if the file exists; otherwise returns false.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
virtual QString next()
Returns the next item in the sequence, or a null object if the end has been reached.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
QStack< QString > m_buffer
De-duplicates and sorts in document order the content that its operand returns.
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QString > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
T pop()
Removes the top item from the stack and returns it.
virtual QString current() const
Returns the current item in the sequence.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void error(const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Item mapToItem(const QString &id, const IDContext &context) const
The QStringList class provides a list of strings.
The QAbstractXmlForwardIterator class is a base class for forward iterators.
The namespace for the internal API of QtXmlPatterns.
virtual qint64 count()
Determines the number of items this QAbstractXmlForwardIterator represents.
void push(const T &t)
Adds element t to the top of the stack.
Contains classes implementing the functions found in XQuery 1.0 and XPath 2.0 Functions and Operators...
QString scheme() const
Returns the scheme of the URL.
Contains functions used for formatting arguments, such as keywords and paths, in translated strings...
Represents an item in the XPath 2.0 Data Model.
void clear()
Clears the contents of the string and makes it empty.
const Item::Iterator::Ptr m_source
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
virtual qint64 position() const
Returns the current position in the sequence represented by this.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QFileInfo class provides system-independent file information.
void wrapExpressionWith(const SourceLocationReflection *const existingNode, const QExplicitlySharedDataPointer< Expression > &newNode)
Ensures source locations are handled in such a manner that existingNode wraps newNode.
virtual ResourceLoader::Ptr resourceLoader() const =0
static bool isNCName(const QStringRef &ncName)
Determines whether c is a valid instance of production [4]NCName in the XML 1.0 Namespaces specificat...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
virtual Item openDocument(const QUrl &uri, const ReportContext::Ptr &context)
Calls to this function are generated by calls to the fn:document() or fn:doc() function.