42 #include <QtCore/QBuffer> 43 #include <QtCore/QStringList> 44 #include <QtXmlPatterns/QXmlFormatter> 420 qWarning(
"A null QIODevice pointer cannot be passed.");
426 qWarning(
"The device must be readable.");
444 "The document URI must be valid.");
479 Q_ASSERT(!canonicalURI.isRelative());
491 catch(
const QPatternist::Exception)
532 qWarning(
"The variable name cannot be null.");
541 if(vl->invalidationRequired(name, variant) || value.
isNull())
544 vl->addBinding(name, variant);
602 qWarning(
"A null, or readable QIODevice must be passed.");
608 qWarning(
"The variable name cannot be null.");
618 if(vl->invalidationRequired(name, variant))
621 vl->addBinding(name, variant);
632 vl->removeBinding(name);
676 qWarning(
"A non-null callback must be passed.");
695 expr->evaluateToSequenceReceiver(dynContext);
699 catch(
const QPatternist::Exception)
727 qWarning(
"A non-null callback must be passed.");
755 while(!next.isNull())
757 target->
append(next.stringValue());
763 catch(
const QPatternist::Exception)
793 qWarning(
"The pointer to the device cannot be null.");
799 qWarning(
"The device must be writable.");
819 qWarning(
"A null pointer cannot be passed.");
837 catch(
const QPatternist::Exception)
866 "The input cannot be null");
874 outputDevice.
close();
966 template<
typename TInputType>
968 const TInputType &focusValue)
993 const QXmlItem focusItem(focusResult.next());
995 if(focusItem.isNull() || focusResult.hasError())
1004 queryInstance->
setFocus(focusItem);
1029 "The URI passed must be valid.");
1052 qWarning(
"A null QIODevice pointer cannot be passed.");
1058 qWarning(
"The device must be readable.");
1146 "The name passed must be a valid NCName.");
1204 if(vl->invalidationRequired(name, variant))
1207 vl->addBinding(name, variant);
const QString & stringForLocalName(const QXmlName::LocalNameCode code) const
The QVariant class acts like a union for the most common Qt data types.
void evaluateTo(QXmlResultItems *result) const
Starts the evaluation and makes it available in result.
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
const QByteArray & data() const
Returns the data contained in the buffer.
bool isReadable() const
Returns true if data can be read from the device; otherwise returns false.
bool isWritable() const
Returns true if data can be written to the device; otherwise returns false.
#define it(className, varName)
void setData(const QByteArray &data)
Sets the contents of the internal buffer to be data.
void bindVariable(const QXmlName &name, const QXmlItem &value)
Binds the variable name to the value so that $name can be used from within the query to refer to the ...
bool open(OpenMode openMode)
Reimplemented Function
QueryLanguage
Specifies whether you want QXmlQuery to interpret the input to setQuery() as an XQuery or as an XSLT ...
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
A smart pointer very similar to std::auto_ptr.
The QByteArray class provides an array of bytes.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
The QXmlResultItems class iterates through the results of evaluating an XQuery in QXmlQuery...
void close()
Reimplemented Function
The QXmlItem class contains either an XML node or an atomic value.
void setQuery(const QString &sourceCode, const QUrl &documentURI=QUrl())
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setNetworkAccessManager(QNetworkAccessManager *newManager)
Sets the network manager to newManager.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool isValid() const
Returns true if this query is valid.
The QBuffer class provides a QIODevice interface for a QByteArray.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
static const EmptyIterator< Item >::Ptr emptyIterator
QPatternist::NetworkAccessDelegator::Ptr m_networkAccessDelegator
void setDynamicContext(const QPatternist::DynamicContext::Ptr &context)
The QXmlNamePool class is a table of shared strings referenced by instances of QXmlName.
virtual void endOfSequence()=0
This callback is called once only, right after the XQuery Sequence ends.
void setUriResolver(const QAbstractUriResolver *resolver)
Sets the URI resolver to resolver.
static const AtomicType::Ptr xsString
QPatternist::VariableLoader::Ptr variableLoader()
QXmlName initialTemplateName() const
Returns the name of the XSL-T stylesheet template that the processor will call first when running an ...
QXmlName initialTemplateName
void append(const T &t)
Inserts value at the end of the list.
The QAbstractUriResolver class is a callback interface for resolving Uniform Resource Identifiers...
#define QT_BEGIN_NAMESPACE
This macro expands to.
~QXmlQuery()
Destroys this QXmlQuery.
QScopedPointer< QXmlResultItemsPrivate > d_ptr
const QAbstractUriResolver * uriResolver() const
Returns the query's URI resolver.
QueryLanguage queryLanguage() const
Returns a value indicating what this QXmlQuery is being used for.
The QXmlSerializer class is an implementation of QAbstractXmlReceiver for transforming XQuery output ...
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Q_CORE_EXPORT void qWarning(const char *,...)
static QChar fromLatin1(char c)
Converts the Latin-1 character c to its equivalent QChar.
virtual void startOfSequence()=0
This callback is called once only, right before the XQuery Sequence begins.
QExplicitlySharedDataPointer< QPatternist::NamePool > d
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
The QNetworkAccessManager class allows the application to send network requests and receive replies...
QPatternist::Item::Iterator::Ptr iterator
QString localName(const QXmlNamePool &query) const
Returns the local name.
const char * constData() const
Returns a pointer to the data stored in the byte array.
static QNetworkReply * load(const QUrl &uri, QNetworkAccessManager *const networkManager, const ReportContext::Ptr &context, ErrorHandling handling=FailOnError)
Helper function that do NetworkAccessDelegator::get(), but does it blocked.
QPatternist::DeviceResourceLoader::Ptr m_resourceLoader
QXmlQuery::QueryLanguage queryLanguage
#define Q_ASSERT_X(cond, where, what)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
The QAbstractXmlReceiver class provides a callback interface for transforming the output of a QXmlQue...
Represents an item in the XPath 2.0 Data Model.
The QAbstractMessageHandler class provides a callback interface for handling messages.
QXmlQuery & operator=(const QXmlQuery &other)
Assigns other to this QXmlQuery instance.
QPatternist::AccelTreeResourceLoader::Ptr resourceLoader()
static bool isNCName(const QString &candidate)
Returns true if candidate is an NCName.
QAbstractMessageHandler * messageHandler() const
Returns the message handler that handles compile and runtime messages for this QXmlQuery.
QXmlNamePool namePool() const
Returns the name pool used by this QXmlQuery for constructing QXmlName {names}.
void setFocus(const QXmlItem &item)
Sets the focus to item.
const QAbstractUriResolver * uriResolver
QPatternist::Expression::Ptr expression(QIODevice *const queryDevice=0)
QPointer< QAbstractMessageHandler > messageHandler
The QIODevice class is the base interface class of all I/O devices in Qt.
static QUrl normalizeQueryURI(const QUrl &uri)
QPatternist::GenericStaticContext::Ptr staticContext()
QPatternist::DynamicContext::Ptr dynamicContext(QAbstractXmlReceiver *const callback=0)
QNetworkAccessManager * networkAccessManager() const
Returns the network manager, or 0 if it has not been set.
bool isNull() const
Returns true if this QXmlName is not initialized with a valid combination of {namespace URI}...
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
void setInitialTemplateName(const QXmlName &name)
Sets the name of the initial template.
QXmlQuery()
Constructs an invalid, empty query that cannot be used until setQuery() is called.
bool isNull() const
Returns true if this QXmlItem is neither a node nor an atomic value.
void setMessageHandler(QAbstractMessageHandler *messageHandler)
Changes the QAbstractMessageHandler {message handler} for this QXmlQuery to aMessageHandler.
friend bool setFocusHelper(QXmlQuery *const queryInstance, const TInputType &focusValue)