Qt 4.8
|
Tokenizes XSL-T 2.0 documents. More...
#include <qxslttokenizer_p.h>
Public Functions | |
virtual int | commenceScanOnly () |
virtual QUrl | documentURI () const |
Returns the location of the document that MaintainingReader is parsing. Used for error reporting. More... | |
virtual Token | nextToken (YYLTYPE *const sourceLocator) |
virtual void | resumeTokenizationFrom (const int position) |
virtual void | setParserContext (const ParserContext::Ptr &parseInfo) |
XSLTTokenizer (QIODevice *const queryDevice, const QUrl &location, const ReportContext::Ptr &context, const NamePool::Ptr &np) | |
Public Functions inherited from QPatternist::Tokenizer | |
const QUrl & | queryURI () const |
Tokenizer (const QUrl &queryU) | |
Public Functions inherited from QPatternist::TokenSource | |
TokenSource () | |
virtual | ~TokenSource () |
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... | |
Protected Functions | |
virtual bool | isAnyAttributeAllowed () const |
Returns true , if any attribute is allowed on the element currently being validated. More... | |
Private Types | |
enum | ProcessMode { BackwardsCompatible, ForwardCompatible, NormalProcessing } |
enum | State { OutsideDocumentElement, InsideStylesheetModule, InsideSequenceConstructor } |
enum | VariableType { FunctionParameter, GlobalParameter, TemplateParameter, VariableDeclaration, VariableInstruction, WithParamVariable } |
Private Types inherited from QXmlStreamReader | |
enum | Error { NoError, UnexpectedElementError, CustomError, NotWellFormedError, PrematureEndOfDocumentError } |
This enum specifies different error cases. More... | |
enum | ReadElementTextBehaviour { ErrorOnUnexpectedElement, IncludeChildElements, SkipChildElements } |
This enum specifies the different behaviours of readElementText(). More... | |
enum | TokenType { NoToken = 0, Invalid, StartDocument, EndDocument, StartElement, EndElement, Characters, Comment, DTD, EntityReference, ProcessingInstruction } |
This enum specifies the type of token the reader just read. More... | |
Private Functions | |
bool | attributeYesNo (const QString &localName) const |
void | checkForParseError () const |
void | commencingExpression (bool &hasWrittenExpression, TokenSource::Queue *const to) |
YYLTYPE | currentSourceLocator () const |
void | endStorageOfCurrent (TokenSource::Queue *const to) |
void | handleStandardAttributes (const bool isXSLTElement) |
Handles xml:space and standard attributes. More... | |
void | handleValidationAttributes (const bool isLRE) const |
void | handleXMLBase (TokenSource::Queue *const to, QStack< Token > *const queueOnExit, const bool isInstruction=true, const QXmlStreamAttributes *atts=0) |
Generates code for reflecting xml:base attributes. More... | |
void | handleXSLTVersion (TokenSource::Queue *const to, QStack< Token > *const queueOnExit, const bool isXSLTElement, const QXmlStreamAttributes *atts=0, const bool generateCode=true, const bool setGlobalVersion=false) |
void | hasWrittenExpression (bool &beacon) |
void | insideAttributeSet () |
void | insideChoose (TokenSource::Queue *const to) |
void | insideFunction () |
bool | insideSequenceConstructor (TokenSource::Queue *const to, const bool initialAdvance=true, const bool queueEmptyOnEmpty=true) |
bool | insideSequenceConstructor (TokenSource::Queue *const to, QStack< Token > &queueOnExit, const bool initialAdvance=true, const bool queueEmptyOnEmpty=true) |
void | insideStylesheetModule () |
void | insideTemplate () |
bool | isElement (const NodeName &name) const |
bool | isStylesheetElement () const |
bool | isXSLT () const |
void | leaveState () |
void | outsideDocumentElement () |
void | parseFallbacksOnly () |
void | pushState (const State nextState) |
void | queueAVT (const QString &expr, TokenSource::Queue *const to) |
void | queueEmptySequence (TokenSource::Queue *const to) |
void | queueExpression (const QString &expr, TokenSource::Queue *const to, const bool wrapWithParantheses=true) |
void | queueNamespaceDeclarations (TokenSource::Queue *const ts, QStack< Token > *const target, const bool isDeclaration=false) |
void | queueOnExit (QStack< Token > &source, TokenSource::Queue *const destination) |
Sends the tokens in source to destination . More... | |
void | queueParams (const NodeName parentName, TokenSource::Queue *const to) |
bool | queueSelectOrSequenceConstructor (const ReportContext::ErrorCode code, const bool emptynessAllowed, TokenSource::Queue *const to, const QXmlStreamAttributes *const atts=0, const bool queueEmptyOnEmpty=true) |
void | queueSequenceType (const QString &expr) |
void | queueSimpleContentConstructor (const ReportContext::ErrorCode code, const bool emptynessAllowed, TokenSource::Queue *const to, const bool selectOnlyFirst=false) |
void | queueSorting (const bool oneSortRequired, TokenSource::Queue *const to, const bool speciallyTreatWhitespace=false) |
void | queueTextConstructor (QString &chars, bool &hasWrittenExpression, TokenSource::Queue *const to) |
void | queueToken (const Token &token, TokenSource::Queue *const ts) |
void | queueVariableDeclaration (const VariableType variableType, TokenSource::Queue *const to) |
void | queueWithParams (const NodeName parentName, TokenSource::Queue *const to, const bool initialAdvance=true) |
int | readAlternativeAttribute (const QHash< QString, int > &alternatives, const QXmlStreamAttribute &attr) const |
QString | readElementText () |
bool | readToggleAttribute (const QString &attributeName, const QString &isTrue, const QString &isFalse, const QXmlStreamAttributes *const atts=0) const |
void | skipBodyOfParam (const ReportContext::ErrorCode code) |
bool | skipSubTree (const bool exitOnContent=false) |
void | startStorageOfCurrent (TokenSource::Queue *const to) |
void | unexpectedContent (const ReportContext::ErrorCode code=ReportContext::XTSE0010) const |
void | validateElement () const |
bool | whitespaceToSkip () const |
Private Functions inherited from QPatternist::MaintainingReader< XSLTTokenLookup > | |
XSLTTokenLookup ::NodeName | currentElementName () const |
void | error (const QString &message, const ReportContext::ErrorCode code) const |
Convenience function for calling ReportContext::error(). More... | |
bool | hasAttribute (const QString &namespaceURI, const QString &localName) const |
Returns true if the current element has an attribute whose name is namespaceURI and local name is localName . More... | |
bool | hasAttribute (const QString &localName) const |
Returns true if the current element has an attribute whose local name is localName and namespace URI is null. More... | |
bool | isWhitespace () const |
MaintainingReader (const typename ElementDescription< XSLTTokenLookup, typename XSLTTokenLookup ::NodeName >::Hash &elementDescriptions, const QSet< typename XSLTTokenLookup ::NodeName > &standardAttributes, const ReportContext::Ptr &context, QIODevice *const queryDevice) | |
QString | readAttribute (const QString &localName, const QString &namespaceURI=QString()) const |
Returns the value for attribute by name name. More... | |
TokenType | readNext () |
void | validateElement (const typename XSLTTokenLookup ::NodeName name) const |
void | warning (const QString &message) const |
Convenience function for calling ReportContext::warning(). More... | |
virtual | ~MaintainingReader () |
Private Functions inherited from QXmlStreamReader | |
void | addData (const QByteArray &data) |
Adds more data for the reader to read. More... | |
void | addData (const QString &data) |
Adds more data for the reader to read. More... | |
void | addData (const char *data) |
Adds more data for the reader to read. More... | |
void | addExtraNamespaceDeclaration (const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaraction) |
Adds an extraNamespaceDeclaration. More... | |
void | addExtraNamespaceDeclarations (const QXmlStreamNamespaceDeclarations &extraNamespaceDeclaractions) |
Adds a vector of declarations specified by extraNamespaceDeclarations. More... | |
bool | atEnd () const |
Returns true if the reader has read until the end of the XML document, or if an error() has occurred and reading has been aborted. More... | |
QXmlStreamAttributes | attributes () const |
Returns the attributes of a StartElement. More... | |
qint64 | characterOffset () const |
Returns the current character offset, starting with 0. More... | |
void | clear () |
Removes any device() or data from the reader and resets its internal state to the initial state. More... | |
qint64 | columnNumber () const |
Returns the current column number, starting with 0. More... | |
QIODevice * | device () const |
Returns the current device associated with the QXmlStreamReader, or 0 if no device has been assigned. More... | |
QStringRef | documentEncoding () const |
If the state() is StartDocument , this function returns the encoding string as specified in the XML declaration. More... | |
QStringRef | documentVersion () const |
If the state() is StartDocument , this function returns the version string as specified in the XML declaration. More... | |
QStringRef | dtdName () const |
If the state() is DTD , this function returns the DTD's name. More... | |
QStringRef | dtdPublicId () const |
If the state() is DTD , this function returns the DTD's public identifier. More... | |
QStringRef | dtdSystemId () const |
If the state() is DTD , this function returns the DTD's system identifier. More... | |
QXmlStreamEntityDeclarations | entityDeclarations () const |
If the state() is DTD , this function returns the DTD's unparsed (external) entity declarations. More... | |
QXmlStreamEntityResolver * | entityResolver () const |
Returns the entity resolver, or 0 if there is no entity resolver. More... | |
Error | error () const |
Returns the type of the current error, or NoError if no error occurred. More... | |
QString | errorString () const |
Returns the error message that was set with raiseError(). More... | |
bool | hasError () const |
Returns true if an error has occurred, otherwise false . More... | |
bool | isCDATA () const |
Returns true if the reader reports characters that stem from a CDATA section; otherwise returns false. More... | |
bool | isCharacters () const |
Returns true if tokenType() equals Characters ; otherwise returns false. More... | |
bool | isComment () const |
Returns true if tokenType() equals Comment ; otherwise returns false. More... | |
bool | isDTD () const |
Returns true if tokenType() equals DTD ; otherwise returns false. More... | |
bool | isEndDocument () const |
Returns true if tokenType() equals EndDocument ; otherwise returns false. More... | |
bool | isEndElement () const |
Returns true if tokenType() equals EndElement ; otherwise returns false. More... | |
bool | isEntityReference () const |
Returns true if tokenType() equals EntityReference ; otherwise returns false. More... | |
bool | isProcessingInstruction () const |
Returns true if tokenType() equals ProcessingInstruction ; otherwise returns false. More... | |
bool | isStandaloneDocument () const |
Returns true if this document has been declared standalone in the XML declaration; otherwise returns false. More... | |
bool | isStartDocument () const |
Returns true if tokenType() equals StartDocument ; otherwise returns false. More... | |
bool | isStartElement () const |
Returns true if tokenType() equals StartElement ; otherwise returns false. More... | |
bool | isWhitespace () const |
Returns true if the reader reports characters that only consist of white-space; otherwise returns false. More... | |
qint64 | lineNumber () const |
Returns the current line number, starting with 1. More... | |
QStringRef | name () const |
Returns the local name of a StartElement, EndElement, or an EntityReference. More... | |
QXmlStreamNamespaceDeclarations | namespaceDeclarations () const |
If the state() is StartElement , this function returns the element's namespace declarations. More... | |
bool | namespaceProcessing () const |
This property controls whether or not the stream reader processes namespaces. More... | |
QStringRef | namespaceUri () const |
Returns the namespaceUri of a StartElement or EndElement. More... | |
QXmlStreamNotationDeclarations | notationDeclarations () const |
If the state() is DTD , this function returns the DTD's notation declarations. More... | |
QStringRef | prefix () const |
Returns the prefix of a StartElement or EndElement. More... | |
QStringRef | processingInstructionData () const |
Returns the data of a ProcessingInstruction. More... | |
QStringRef | processingInstructionTarget () const |
Returns the target of a ProcessingInstruction. More... | |
QStringRef | qualifiedName () const |
Returns the qualified name of a StartElement or EndElement;. More... | |
QXmlStreamReader () | |
Constructs a stream reader. More... | |
QXmlStreamReader (QIODevice *device) | |
Creates a new stream reader that reads from device. More... | |
QXmlStreamReader (const QByteArray &data) | |
Creates a new stream reader that reads from data. More... | |
QXmlStreamReader (const QString &data) | |
Creates a new stream reader that reads from data. More... | |
QXmlStreamReader (const char *data) | |
Creates a new stream reader that reads from data. More... | |
void | raiseError (const QString &message=QString()) |
Raises a custom error with an optional error message. More... | |
QString | readElementText (ReadElementTextBehaviour behaviour) |
Convenience function to be called in case a StartElement was read. More... | |
QString | readElementText () |
TokenType | readNext () |
Reads the next token and returns its type. More... | |
bool | readNextStartElement () |
Reads until the next start element within the current element. More... | |
void | setDevice (QIODevice *device) |
Sets the current device to device. More... | |
void | setEntityResolver (QXmlStreamEntityResolver *resolver) |
Makes resolver the new entityResolver(). More... | |
void | setNamespaceProcessing (bool) |
void | skipCurrentElement () |
Reads until the end of the current element, skipping any child nodes. More... | |
QStringRef | text () const |
Returns the text of Characters , Comment , DTD , or EntityReference. More... | |
QString | tokenString () const |
Returns the reader's current token as string. More... | |
TokenType | tokenType () const |
Returns the type of the current token. More... | |
~QXmlStreamReader () | |
Destructs the reader. More... | |
Static Private Functions | |
static ElementDescription< XSLTTokenLookup >::Hash | createElementDescriptions () |
static QSet< NodeName > | createStandardAttributes () |
static QHash< QString, int > | createValidationAlternatives () |
Properties | |
const QUrl | m_location |
const NamePool::Ptr | m_namePool |
ParserContext::Ptr | m_parseInfo |
QStack< ProcessMode > | m_processingMode |
QStack< State > | m_state |
TokenSource::Queue | m_tokenSource |
const QHash< QString, int > | m_validationAlternatives |
Properties inherited from QPatternist::MaintainingReader< XSLTTokenLookup > | |
QXmlStreamAttributes | m_currentAttributes |
bool | m_hasHandledStandardAttributes |
QStack< bool > | m_stripWhitespace |
Additional Inherited Members | |
Public Types inherited from QPatternist::Tokenizer | |
typedef QExplicitlySharedDataPointer< Tokenizer > | Ptr |
Public Types inherited from QPatternist::TokenSource | |
typedef QExplicitlySharedDataPointer< TokenSource > | Ptr |
typedef QQueue< Ptr > | Queue |
typedef yytokentype | TokenType |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Static Protected Functions inherited from QPatternist::Tokenizer | |
static QString | tokenToString (const Token &token) |
Tokenizes XSL-T 2.0 documents.
XSLTTokenizer takes in its constructor a pointer to a QIODevice which is supposed to contain an XSL-T document. XSLTTokenizer then rewrites that document into XQuery tokens delivered via nextToken(), which the regular XQuery parser then reads. Hence, the XSL-T language is rewritten into XQuery code, slightly extended to handle the featuress specific to XSL-T.
Definition at line 112 of file qxslttokenizer_p.h.
|
private |
Enumerator | |
---|---|
BackwardsCompatible | |
ForwardCompatible | |
NormalProcessing |
Definition at line 444 of file qxslttokenizer_p.h.
|
private |
Enumerator | |
---|---|
OutsideDocumentElement | |
InsideStylesheetModule | |
InsideSequenceConstructor |
Definition at line 151 of file qxslttokenizer_p.h.
|
private |
Enumerator | |
---|---|
FunctionParameter | |
GlobalParameter | |
TemplateParameter | |
VariableDeclaration | |
VariableInstruction | |
WithParamVariable |
Definition at line 158 of file qxslttokenizer_p.h.
XSLTTokenizer::XSLTTokenizer | ( | QIODevice *const | queryDevice, |
const QUrl & | location, | ||
const ReportContext::Ptr & | context, | ||
const NamePool::Ptr & | np | ||
) |
XSLTTokenizer do not own queryDevice
.
Definition at line 68 of file qxslttokenizer.cpp.
|
private |
Definition at line 2512 of file qxslttokenizer.cpp.
Referenced by insideFunction(), queueParams(), queueSorting(), queueVariableDeclaration(), and queueWithParams().
|
private |
Definition at line 544 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideStylesheetModule(), outsideDocumentElement(), queueSorting(), readElementText(), and skipSubTree().
|
virtual |
For XSLT we don't need this mechanism, so we do nothing.
Implements QPatternist::Tokenizer.
Definition at line 580 of file qxslttokenizer.cpp.
|
private |
Definition at line 1120 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), and queueTextConstructor().
|
staticprivate |
Definition at line 121 of file qxslttokenizer.cpp.
|
staticprivate |
Definition at line 99 of file qxslttokenizer.cpp.
Definition at line 477 of file qxslttokenizer.cpp.
|
private |
Definition at line 2708 of file qxslttokenizer.cpp.
Referenced by nextToken(), and queueToken().
|
inlinevirtual |
Returns the location of the document that MaintainingReader is parsing. Used for error reporting.
Implements QPatternist::MaintainingReader< XSLTTokenLookup >.
Definition at line 138 of file qxslttokenizer_p.h.
|
inlineprivate |
Definition at line 1481 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Handles xml:space
and standard attributes.
If isXSLTElement
is true
, the current element is an XSL-T element, as opposed to a Literal Result Element.
handleStandardAttributes() must be called before validateElement(), because the former determines the version in use, and validateElement() depends on that.
The core of this function can't be run many times because it pushes whitespace handling onto m_stripWhitespace. m_hasHandledStandardAttributes protects helping against this.
Definition at line 681 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideSequenceConstructor(), insideStylesheetModule(), insideTemplate(), and outsideDocumentElement().
|
private |
Handles the type
and validation
attribute on instructions and literal result elements.
isLRE
should be true if the current element is not in the XSL-T namespace, that is if it's a Literal Result Element.
Definition at line 747 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Generates code for reflecting xml:base
attributes.
Definition at line 649 of file qxslttokenizer.cpp.
Referenced by insideFunction(), insideSequenceConstructor(), insideTemplate(), and outsideDocumentElement().
|
private |
Checks that attribute
has a value in accordance with what is allowed and supported.
Definition at line 592 of file qxslttokenizer.cpp.
Referenced by insideFunction(), insideSequenceConstructor(), insideStylesheetModule(), insideTemplate(), and outsideDocumentElement().
|
private |
Referenced by insideSequenceConstructor().
|
private |
Definition at line 2316 of file qxslttokenizer.cpp.
Referenced by insideStylesheetModule().
|
private |
Definition at line 1135 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Definition at line 2672 of file qxslttokenizer.cpp.
Referenced by insideStylesheetModule().
|
private |
If initialAdvance
is true
, insideSequenceConstructor() will advance m_reader, otherwise it won't. Not doing so is useful when the caller is already inside a sequence constructor.
Returns true
if a sequence constructor was found and queued. Returns false
if none was found, and the empty sequence was synthesized.
Definition at line 1519 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideFunction(), insideSequenceConstructor(), insideTemplate(), nextToken(), outsideDocumentElement(), and queueSelectOrSequenceConstructor().
|
private |
Definition at line 1527 of file qxslttokenizer.cpp.
|
private |
Definition at line 2349 of file qxslttokenizer.cpp.
Referenced by nextToken(), and outsideDocumentElement().
|
private |
Definition at line 987 of file qxslttokenizer.cpp.
Referenced by insideStylesheetModule().
|
protectedvirtual |
Returns true
, if any attribute is allowed on the element currently being validated.
Implements QPatternist::MaintainingReader< XSLTTokenLookup >.
Definition at line 84 of file qxslttokenizer.cpp.
|
private |
Returns true if the current element name is name
.
It is assumed that the namespace is XSL-T and that the current state in m_reader is either QXmlStreamReader::StartElement or QXmlStreamReader::EndElement.
Definition at line 831 of file qxslttokenizer.cpp.
Referenced by insideAttributeSet(), insideSequenceConstructor(), queueParams(), queueSorting(), and queueWithParams().
|
private |
Returns true if the current element is either stylesheet
or the synonym transform
.
This function assumes that m_reader is positioned at an element and that the namespace is XSL-T.
Definition at line 2103 of file qxslttokenizer.cpp.
Referenced by outsideDocumentElement().
|
inlineprivate |
Returns true
if the current state in m_reader is in the XSLT namespace. It is assumed that the current state is an element.
Definition at line 840 of file qxslttokenizer.cpp.
Referenced by insideAttributeSet(), insideChoose(), insideSequenceConstructor(), insideStylesheetModule(), isElement(), isStylesheetElement(), outsideDocumentElement(), parseFallbacksOnly(), queueParams(), queueSorting(), queueWithParams(), skipBodyOfParam(), and unexpectedContent().
|
private |
Definition at line 982 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), and insideStylesheetModule().
|
virtual |
Implements QPatternist::TokenSource.
Definition at line 787 of file qxslttokenizer.cpp.
|
private |
Definition at line 857 of file qxslttokenizer.cpp.
Referenced by nextToken().
|
private |
Scans/skips xsl:fallback
elements only. This is the case of the children of xsl:sequence
, for instance.
Definition at line 2307 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Definition at line 977 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideFunction(), insideSequenceConstructor(), insideTemplate(), outsideDocumentElement(), queueSelectOrSequenceConstructor(), and XSLTTokenizer().
|
private |
Tokenizes and queues expr
as if it was an attribute value template.
Definition at line 1104 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), queueSimpleContentConstructor(), and queueSorting().
|
private |
Definition at line 1129 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideSequenceConstructor(), and queueVariableDeclaration().
|
private |
Takes expr
for an XPath expression, and pushes the necessary things for having it delivered as a stream of token, appropriate for Effective Boolean Value parsing.
Definition at line 1089 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideSequenceConstructor(), insideTemplate(), queueSelectOrSequenceConstructor(), and queueVariableDeclaration().
|
private |
Definition at line 1486 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), and outsideDocumentElement().
|
inlineprivate |
Sends the tokens in source
to destination
.
Definition at line 850 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideSequenceConstructor(), insideTemplate(), and outsideDocumentElement().
|
private |
Definition at line 2185 of file qxslttokenizer.cpp.
Referenced by insideFunction(), and insideTemplate().
|
private |
Queues the necessary tokens for the expression that is either supplied using a select
attribute or a sequence constructor, while doing the necessary error handling for ensuring they are mutually exclusive.
It is assumed that the current state of m_reader is QXmlStreamReader::StartElement, or that the attributes for the element is supplied through atts
. This function advances m_reader up until the corresponding QXmlStreamReader::EndElement.
If emptynessAllowed
is false
, the element must either have a sequence constructor or a select
attribute. If true
, both may be absent.
Returns true
if the queued expression was supplied through the select
attribute otherwise false
.
Definition at line 1262 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), queueSimpleContentConstructor(), queueSorting(), and queueVariableDeclaration().
|
private |
Definition at line 1114 of file qxslttokenizer.cpp.
Referenced by insideFunction(), insideTemplate(), and queueVariableDeclaration().
|
private |
If emptynessAllowed
is true
, the select
attribute may be empty while there also is no sequence constructor.
Definition at line 1303 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Tokenizes and validate xsl:sort statements, if any, until other content is encountered. The produced tokens are returned in a list.
If oneSortRequired
, at least one sort
element must appear, otherwise an error is raised.
If speciallyTreatWhitespace
whitespace will be treated as if it was one of the elements mentioned in step 4 in section 4.2 Stripping Whitespace from the Stylesheet.
Definition at line 2517 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Queues a text constructor for chars
, if chars
is not empty.
Definition at line 1344 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
inlineprivate |
Definition at line 969 of file qxslttokenizer.cpp.
Referenced by commencingExpression(), endStorageOfCurrent(), handleXMLBase(), handleXSLTVersion(), insideChoose(), insideFunction(), insideSequenceConstructor(), insideTemplate(), outsideDocumentElement(), queueAVT(), queueEmptySequence(), queueExpression(), queueNamespaceDeclarations(), queueOnExit(), queueParams(), queueSimpleContentConstructor(), queueSorting(), queueTextConstructor(), queueVariableDeclaration(), queueWithParams(), and startStorageOfCurrent().
|
private |
Queues an xsl:variable
declaration. If isInstruction
is true
, it is assumed to be a an instruction, otherwise a top-level declaration element.
Definition at line 1359 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), insideStylesheetModule(), queueParams(), and queueWithParams().
|
private |
Used for xsl:apply-templates
and xsl:call-templates
.
Definition at line 2127 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Definition at line 2497 of file qxslttokenizer.cpp.
Referenced by handleValidationAttributes().
|
private |
Concatenates text nodes, ignores comments and processing instructions, and raises errors on everything else.
Hence, similar to QXmlStreamReader::readElementText(), except for error handling.
Definition at line 552 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor().
|
private |
Reads the attribute by name attributeName
, and returns true
if its value is isTrue
, false
if it is isFalse
, and raise an error otherwise.
Definition at line 2470 of file qxslttokenizer.cpp.
Referenced by attributeYesNo(), handleStandardAttributes(), and queueSorting().
|
virtual |
For XSLT we don't need this mechanism, so we do nothing.
Implements QPatternist::Tokenizer.
Definition at line 586 of file qxslttokenizer.cpp.
|
virtual |
Implements QPatternist::Tokenizer.
Definition at line 89 of file qxslttokenizer.cpp.
|
private |
Definition at line 2113 of file qxslttokenizer.cpp.
Referenced by queueVariableDeclaration().
|
private |
Skips the current sub-tree.
If text nodes that aren't strippable whitespace, or elements are encountered, true
is returned, otherwise false
.
If exitOnContent
is true
, this function exits immediately if content is encountered for which it would return false
.
Definition at line 2259 of file qxslttokenizer.cpp.
Referenced by insideAttributeSet(), insideSequenceConstructor(), insideStylesheetModule(), parseFallbacksOnly(), queueSelectOrSequenceConstructor(), and skipBodyOfParam().
|
inlineprivate |
Definition at line 1475 of file qxslttokenizer.cpp.
Referenced by insideSequenceConstructor(), and insideTemplate().
|
private |
Definition at line 494 of file qxslttokenizer.cpp.
Referenced by insideAttributeSet(), insideChoose(), insideSequenceConstructor(), insideStylesheetModule(), queueSorting(), queueWithParams(), and readElementText().
|
inlineprivate |
Definition at line 94 of file qxslttokenizer.cpp.
Referenced by insideChoose(), insideSequenceConstructor(), insideStylesheetModule(), outsideDocumentElement(), and queueParams().
|
inlineprivate |
Returns true
if the current text node can be skipped without it leading to a validation error, with respect to whitespace.
Definition at line 489 of file qxslttokenizer.cpp.
Referenced by insideAttributeSet(), insideSequenceConstructor(), queueParams(), queueSorting(), queueWithParams(), skipSubTree(), and unexpectedContent().
|
private |
Definition at line 439 of file qxslttokenizer_p.h.
|
private |
Definition at line 440 of file qxslttokenizer_p.h.
Referenced by handleXSLTVersion(), and XSLTTokenizer().
|
private |
Definition at line 473 of file qxslttokenizer_p.h.
Referenced by handleXSLTVersion(), and setParserContext().
|
private |
Whether we're processing in Forwards-Compatible or Backwards-Compatible mode.
This is set by handleStandardAttributes().
ParserContext have similar information in ParserContext::isBackwardsCompat. A big distinction is that both the tokenizer and the parser buffer tokens and have positions disjoint to each other. E.g, the state the parser has when reducing into non-terminals, is different from the tokenizer's.
Definition at line 463 of file qxslttokenizer_p.h.
Referenced by handleXSLTVersion(), insideSequenceConstructor(), insideStylesheetModule(), and isAnyAttributeAllowed().
Definition at line 441 of file qxslttokenizer_p.h.
Referenced by leaveState(), nextToken(), and pushState().
|
private |
Definition at line 442 of file qxslttokenizer_p.h.
Referenced by insideFunction(), insideSequenceConstructor(), insideStylesheetModule(), insideTemplate(), nextToken(), outsideDocumentElement(), queueExpression(), queueSequenceType(), and queueToken().
Definition at line 471 of file qxslttokenizer_p.h.
Referenced by handleValidationAttributes().