52 #ifdef Q_CC_BOR // borland 6 finds bogus warnings when building this file in uic3 59 #define XMLERR_OK QT_TRANSLATE_NOOP("QXml", "no error occurred") 60 #define XMLERR_ERRORBYCONSUMER QT_TRANSLATE_NOOP("QXml", "error triggered by consumer") 61 #define XMLERR_UNEXPECTEDEOF QT_TRANSLATE_NOOP("QXml", "unexpected end of file") 62 #define XMLERR_MORETHANONEDOCTYPE QT_TRANSLATE_NOOP("QXml", "more than one document type definition") 63 #define XMLERR_ERRORPARSINGELEMENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing element") 64 #define XMLERR_TAGMISMATCH QT_TRANSLATE_NOOP("QXml", "tag mismatch") 65 #define XMLERR_ERRORPARSINGCONTENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing content") 66 #define XMLERR_UNEXPECTEDCHARACTER QT_TRANSLATE_NOOP("QXml", "unexpected character") 67 #define XMLERR_INVALIDNAMEFORPI QT_TRANSLATE_NOOP("QXml", "invalid name for processing instruction") 68 #define XMLERR_VERSIONEXPECTED QT_TRANSLATE_NOOP("QXml", "version expected while reading the XML declaration") 69 #define XMLERR_WRONGVALUEFORSDECL QT_TRANSLATE_NOOP("QXml", "wrong value for standalone declaration") 70 #define XMLERR_EDECLORSDDECLEXPECTED QT_TRANSLATE_NOOP("QXml", "encoding declaration or standalone declaration expected while reading the XML declaration") 71 #define XMLERR_SDDECLEXPECTED QT_TRANSLATE_NOOP("QXml", "standalone declaration expected while reading the XML declaration") 72 #define XMLERR_ERRORPARSINGDOCTYPE QT_TRANSLATE_NOOP("QXml", "error occurred while parsing document type definition") 73 #define XMLERR_LETTEREXPECTED QT_TRANSLATE_NOOP("QXml", "letter is expected") 74 #define XMLERR_ERRORPARSINGCOMMENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing comment") 75 #define XMLERR_ERRORPARSINGREFERENCE QT_TRANSLATE_NOOP("QXml", "error occurred while parsing reference") 76 #define XMLERR_INTERNALGENERALENTITYINDTD QT_TRANSLATE_NOOP("QXml", "internal general entity reference not allowed in DTD") 77 #define XMLERR_EXTERNALGENERALENTITYINAV QT_TRANSLATE_NOOP("QXml", "external parsed general entity reference not allowed in attribute value") 78 #define XMLERR_EXTERNALGENERALENTITYINDTD QT_TRANSLATE_NOOP("QXml", "external parsed general entity reference not allowed in DTD") 79 #define XMLERR_UNPARSEDENTITYREFERENCE QT_TRANSLATE_NOOP("QXml", "unparsed entity reference in wrong context") 80 #define XMLERR_RECURSIVEENTITIES QT_TRANSLATE_NOOP("QXml", "recursive entities") 81 #define XMLERR_ERRORINTEXTDECL QT_TRANSLATE_NOOP("QXml", "error in the text declaration of an external entity") 86 static const signed char cltWS = 0;
89 static const signed char cltGt = 3;
90 static const signed char cltLt = 4;
92 static const signed char cltQm = 6;
93 static const signed char cltEm = 7;
95 static const signed char cltCB = 9;
96 static const signed char cltOB = 10;
97 static const signed char cltEq = 11;
98 static const signed char cltDq = 12;
99 static const signed char cltSq = 13;
195 "(version\\s*=\\s*((['\"])[-a-zA-Z0-9_.:]+\\3))?" 197 "(encoding\\s*=\\s*((['\"])[A-Za-z][-a-zA-Z0-9_.]*\\6))?" 237 #ifndef QT_NO_TEXTCODEC 249 : column(-1), line(-1)
253 : msg(other.msg), column(other.column), line(other.line),
254 pub(other.pub), sys(other.sys)
281 void initIncrementalParsing();
294 : publicId(p), systemId(s) {}
304 : publicId(p), systemId(s), notation(n) {}
320 :
name(_name), value(_value),
index(0) {}
384 ParseFunction
function;
434 static const int dtdRecursionLimit = 2;
436 static const int entityCharacterLimit = 1024;
440 void stringAddC(
QChar);
444 void nameAddC(
QChar);
461 bool entityExist(
const QString&)
const;
463 bool parseBeginOrContinue(
int state,
bool incremental);
467 bool processElementEmptyTag();
468 bool processElementETagBegin2();
469 bool processElementAttribute();
479 bool parseAttribute();
480 bool parseReference();
481 bool processReference();
483 bool parseExternalID();
484 bool parsePEReference();
485 bool parseMarkupdecl();
486 bool parseAttlistDecl();
488 bool parseAttValue();
489 bool parseElementDecl();
490 bool parseNotationDecl();
491 bool parseChoiceSeq();
492 bool parseEntityDecl();
493 bool parseEntityValue();
499 bool reportEndEntities();
500 void reportParseError(
const QString& error);
503 void unexpectedEof(ParseFunction where,
int state);
504 void parseFailed(ParseFunction where,
int state);
505 void pushParseState(ParseFunction
function,
int state);
506 bool isExpandedEntityValueTooLarge(
QString *errorMessage);
795 d->ns.insert(pre, uri);
812 while ((itc=it) !=
d->ns.constEnd()) {
814 if (*itc == uri && !itc.key().
isEmpty())
827 return d->ns[prefix];
843 prefix = qname.
left(pos);
844 localname = qname.
mid(pos+1);
868 int len = qname.
size();
870 for (
int pos = 0; pos < len; ++pos) {
872 nsuri = uri(qname.
left(pos));
873 localname = qname.
mid(pos + 1);
881 if (!isAttribute && !
d->ns.isEmpty()) {
888 if (first.key().isEmpty())
889 nsuri = first.value();
906 while ((itc=it) !=
d->ns.constEnd()) {
908 if (!itc.key().isEmpty())
936 while ((itc=it) !=
d->ns.constEnd()) {
938 if (*itc == uri && !itc.key().
isEmpty())
956 d->nsStack.push(
d->ns);
971 if(!
d->nsStack.isEmpty())
972 d->ns =
d->nsStack.pop();
1043 for (
int i = 0; i < attList.size(); ++i) {
1044 if (attList.at(i).qname == qName)
1054 for (
int i = 0; i < attList.size(); ++i) {
1055 if (attList.at(i).qname == qName)
1079 for (
int i = 0; i < attList.size(); ++i) {
1094 return attList.
count();
1116 return attList.at(index).localname;
1127 return attList.at(index).qname;
1139 return attList.at(index).
uri;
1194 return attList.at(index).
value;
1210 int i =
index(qName);
1213 return attList.at(i).
value;
1229 int i =
index(qName);
1232 return attList.at(i).
value;
1249 int i =
index(uri, localName);
1252 return attList.at(i).
value;
1351 #ifndef QT_NO_TEXTCODEC 1354 d->nextReturnedEndOfData =
true;
1356 d->encodingDeclBytes.clear();
1357 d->encodingDeclChars.clear();
1358 d->lookingForEncodingDecl =
true;
1386 d->inputDevice = dev;
1388 d->inputDevice->setTextModeEnabled(
false);
1410 d->inputDevice = &file;
1420 #ifndef QT_NO_TEXTCODEC 1421 delete d->encMapper;
1446 if (
d->pos >=
d->length) {
1447 if (
d->nextReturnedEndOfData) {
1448 d->nextReturnedEndOfData =
false;
1450 if (
d->pos >=
d->length) {
1451 return EndOfDocument;
1455 d->nextReturnedEndOfData =
true;
1462 QChar c =
d->unicode[
d->pos++];
1481 d->nextReturnedEndOfData =
false;
1493 if (
d->nextReturnedEndOfData) {
1514 d->length =
d->str.length();
1515 d->nextReturnedEndOfData =
false;
1560 if (
d->inputDevice ||
d->inputStream) {
1561 QIODevice *device =
d->inputDevice ?
d->inputDevice :
d->inputStream->device();
1564 if (
d->inputStream &&
d->inputStream->string()) {
1565 QString *s =
d->inputStream->string();
1569 rawData.
resize(BufferSize);
1577 int ret = device->
read(rawData.
data() + size, BufferSize - size);
1591 setData(fromRawData(rawData));
1595 #ifndef QT_NO_TEXTCODEC 1598 *needMoreText =
false;
1607 *needMoreText = l < 255;
1612 if (pos == -1 || pos >= endPos)
1615 while (pos < endPos) {
1617 if (uc ==
'\'' || uc ==
'"')
1627 while (pos < endPos) {
1629 if (uc ==
'\'' || uc ==
'"')
1637 #endif // QT_NO_TEXTCODEC 1652 #ifdef QT_NO_TEXTCODEC 1656 if (data.
size() == 0)
1659 delete d->encMapper;
1666 if (
d->encMapper == 0) {
1667 d->encodingDeclBytes.clear();
1668 d->encodingDeclChars.clear();
1669 d->lookingForEncodingDecl =
true;
1672 if (data.
size() >= 4) {
1678 if ((ch1 == 0 && ch2 == 0 && ch3 == 0xfe && ch4 == 0xff) ||
1679 (ch1 == 0xff && ch2 == 0xfe && ch3 == 0 && ch4 == 0))
1681 else if (ch1 == 0x3c && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x00)
1683 else if (ch1 == 0x00 && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x3c)
1686 if (mib == 106 && data.
size() >= 2) {
1690 if ((ch1 == 0xfe && ch2 == 0xff) || (ch1 == 0xff && ch2 == 0xfe))
1692 else if (ch1 == 0x3c && ch2 == 0x00)
1694 else if (ch1 == 0x00 && ch2 == 0x3c)
1704 QString input =
d->encMapper->toUnicode(data, data.
size());
1706 if (
d->lookingForEncodingDecl) {
1707 d->encodingDeclChars += input;
1716 delete d->encMapper;
1725 d->encMapper->toUnicode(
d->encodingDeclBytes,
d->encodingDeclBytes.size());
1727 input =
d->encMapper->toUnicode(data, data.
size());
1732 d->encodingDeclBytes +=
data;
1733 d->lookingForEncodingDecl = needMoreText;
3012 return (c.
unicode()|0x0001) == 0xffff;
3017 stringValueLen = 0; stringArrayPos = 0;
3021 nameValueLen = 0; nameArrayPos = 0;
3026 refValueLen = 0; refArrayPos = 0;
3043 useNamespaces =
true;
3044 useNamespacePrefixes =
false;
3045 reportWhitespaceCharData =
true;
3046 reportEntities =
false;
3057 parseStack->
clear();
3383 return (uc ==
' ' || uc ==
'\t' || uc ==
'\n' || uc ==
'\r');
3390 static const char NotN = (char)NotName;
3424 return (
NameChar)nameCharTable[uc];
3468 if (name ==
QLatin1String(
"http://xml.org/sax/features/namespaces")) {
3470 }
else if (name ==
QLatin1String(
"http://xml.org/sax/features/namespace-prefixes")) {
3472 }
else if (name ==
QLatin1String(
"http://trolltech.com/xml/features/report-whitespace-only-CharData")) {
3474 }
else if (name ==
QLatin1String(
"http://trolltech.com/xml/features/report-start-end-entity")) {
3521 if (name ==
QLatin1String(
"http://xml.org/sax/features/namespaces")) {
3522 d->useNamespaces = enable;
3523 }
else if (name ==
QLatin1String(
"http://xml.org/sax/features/namespace-prefixes")) {
3524 d->useNamespacePrefixes = enable;
3525 }
else if (name ==
QLatin1String(
"http://trolltech.com/xml/features/report-whitespace-only-CharData")) {
3526 d->reportWhitespaceCharData = enable;
3527 }
else if (name ==
QLatin1String(
"http://trolltech.com/xml/features/report-start-end-entity")) {
3528 d->reportEntities = enable;
3539 if (name ==
QLatin1String(
"http://xml.org/sax/features/namespaces")
3540 || name ==
QLatin1String(
"http://xml.org/sax/features/namespace-prefixes")
3541 || name ==
QLatin1String(
"http://trolltech.com/xml/features/report-whitespace-only-CharData")
3542 || name ==
QLatin1String(
"http://trolltech.com/xml/features/report-start-end-entity")) {
3687 return parse(&input,
false);
3696 return parse(input,
false);
3728 d->literalEntitySizes.clear();
3729 d->referencesToOtherEntities.clear();
3730 d->expandedSizes.clear();
3733 d->initIncrementalParsing();
3735 delete d->parseStack;
3741 if (
d->contentHnd) {
3742 d->contentHnd->setDocumentLocator(
d->locator.data());
3743 if (!
d->contentHnd->startDocument()) {
3744 d->reportParseError(
d->contentHnd->errorString());
3750 return d->parseBeginOrContinue(0, incremental);
3781 if (
d->parseStack == 0 ||
d->parseStack->isEmpty())
3784 int state =
d->parseStack->pop().state;
3785 return d->parseBeginOrContinue(state,
true);
3793 bool atEndOrig = atEnd();
3796 if (!parseProlog()) {
3797 if (incremental && error.
isNull()) {
3798 pushParseState(0, 0);
3808 if (!parseElement()) {
3809 if (incremental && error.
isNull()) {
3810 pushParseState(0, 1);
3822 if (incremental && error.
isNull()) {
3823 pushParseState(0, 2);
3831 if (!atEndOrig && incremental) {
3833 pushParseState(0, 2);
3936 const signed char Init = 0;
3937 const signed char EatWS = 1;
3938 const signed char Lt = 2;
3939 const signed char Em = 3;
3940 const signed char DocType = 4;
3941 const signed char Comment = 5;
3942 const signed char CommentR = 6;
3943 const signed char PInstr = 7;
3944 const signed char PInstrR = 8;
3945 const signed char Done = 9;
3947 const signed char InpWs = 0;
3948 const signed char InpLt = 1;
3949 const signed char InpQm = 2;
3950 const signed char InpEm = 3;
3951 const signed char InpD = 4;
3952 const signed char InpDash = 5;
3953 const signed char InpUnknown = 6;
3955 static const signed char table[9][7] = {
3957 { EatWS,
Lt, -1, -1, -1, -1, -1 },
3958 { -1,
Lt, -1, -1, -1, -1, -1 },
3959 { -1, -1, PInstr,Em, Done, -1, Done },
3960 { -1, -1, -1, -1, DocType,
Comment, -1 },
3961 { EatWS,
Lt, -1, -1, -1, -1, -1 },
3962 { EatWS,
Lt, -1, -1, -1, -1, -1 },
3963 { EatWS,
Lt, -1, -1, -1, -1, -1 },
3964 { EatWS,
Lt, -1, -1, -1, -1, -1 },
3965 { EatWS,
Lt, -1, -1, -1, -1, -1 }
3970 if (parseStack == 0 || parseStack->
isEmpty()) {
3971 xmldecl_possible =
true;
3972 doctype_read =
false;
3975 state = parseStack->
pop().state;
3976 #if defined(QT_QXML_DEBUG) 3977 qDebug(
"QXmlSimpleReader: parseProlog (cont) in state %d", state);
3980 ParseFunction
function = parseStack->
top().function;
3983 #if defined(QT_QXML_DEBUG) 3984 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
3987 if (!(this->*
function)()) {
4001 doctype_read =
false;
4006 if (!lexicalHnd->
comment(
string())) {
4016 if (xmldecl_possible && !xmlVersion.
isEmpty()) {
4018 value += xmlVersion;
4042 xmldecl_possible =
false;
4071 state = table[state][input];
4076 xmldecl_possible =
false;
4087 xmldecl_possible =
false;
4091 if (!parseDoctype()) {
4098 if (!parseComment()) {
4105 parsePI_xmldecl = xmldecl_possible;
4124 const int ReadName = 1;
4126 const int STagEnd = 3;
4127 const int STagEnd2 = 4;
4128 const int ETagBegin = 5;
4129 const int ETagBegin2 = 6;
4131 const int EmptyTag = 8;
4132 const int Attrib = 9;
4133 const int AttribPro = 10;
4135 const int Done = 12;
4137 const int InpWs = 0;
4138 const int InpNameBe = 1;
4139 const int InpGt = 2;
4140 const int InpSlash = 3;
4141 const int InpUnknown = 4;
4143 static const int table[12][5] = {
4145 { -1, ReadName, -1, -1, -1 },
4146 { Ws1, Attrib, STagEnd, EmptyTag, -1 },
4147 { -1, Attrib, STagEnd, EmptyTag, -1 },
4148 { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 },
4149 { -1, -1, -1, ETagBegin, -1 },
4150 { -1, ETagBegin2, -1, -1, -1 },
4151 { Ws2, -1, Done, -1, -1 },
4152 { -1, -1, Done, -1, -1 },
4153 { -1, -1, Done, -1, -1 },
4154 { Ws3, Attrib, STagEnd, EmptyTag, -1 },
4155 { Ws3, Attrib, STagEnd, EmptyTag, -1 },
4156 { -1, Attrib, STagEnd, EmptyTag, -1 }
4161 if (parseStack == 0 || parseStack->
isEmpty()) {
4164 state = parseStack->
pop().state;
4165 #if defined(QT_QXML_DEBUG) 4166 qDebug(
"QXmlSimpleReader: parseElement (cont) in state %d", state);
4169 ParseFunction
function = parseStack->
top().function;
4172 #if defined(QT_QXML_DEBUG) 4173 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
4176 if (!(this->*
function)()) {
4194 if (!processElementETagBegin2())
4198 if (!processElementAttribute())
4217 }
else if (
is_S(c)) {
4224 state = table[state][input];
4228 parseName_useRef =
false;
4246 if (useNamespaces) {
4248 namespaceSupport.
processName(tagsTop,
false, uri, lname);
4249 if (!contentHnd->
startElement(uri, lname, tagsTop, attList)) {
4263 if (!parseContent()) {
4273 parseName_useRef =
false;
4284 if (!processElementEmptyTag())
4291 if (!parseAttribute()) {
4313 if (useNamespaces) {
4328 prefixesBefore = namespaceSupport.
prefixes();
4332 prefixesAfter = namespaceSupport.
prefixes();
4377 namespaceSupport.
processName(name,
false, uri, lname);
4378 if (!contentHnd->
endElement(uri, lname, name)) {
4383 if (useNamespaces) {
4384 NamespaceMap prefixesBefore, prefixesAfter;
4386 prefixesBefore = namespaceSupport.
d->
ns;
4391 prefixesAfter = namespaceSupport.
d->
ns;
4392 if (prefixesBefore.
size() != prefixesAfter.
size()) {
4394 if (!
it.key().isEmpty() && !prefixesAfter.
contains(
it.key())) {
4417 if (useNamespaces) {
4419 namespaceSupport.
splitName(name, prefix, lname);
4422 namespaceSupport.
setPrefix(lname,
string);
4423 if (useNamespacePrefixes) {
4438 namespaceSupport.
processName(name,
true, uri, lname);
4439 attList.
append(name, uri, lname,
string);
4443 attList.
append(name, uri, lname,
string);
4456 const signed char Init = 0;
4457 const signed char ChD = 1;
4458 const signed char ChD1 = 2;
4459 const signed char ChD2 = 3;
4460 const signed char Ref = 4;
4461 const signed char Lt = 5;
4462 const signed char PInstr = 6;
4463 const signed char PInstrR = 7;
4464 const signed char Elem = 8;
4465 const signed char Em = 9;
4466 const signed char Com = 10;
4467 const signed char ComR = 11;
4468 const signed char CDS = 12;
4469 const signed char CDS1 = 13;
4470 const signed char CDS2 = 14;
4471 const signed char CDS3 = 15;
4472 const signed char Done = 16;
4474 const signed char InpLt = 0;
4475 const signed char InpGt = 1;
4476 const signed char InpSlash = 2;
4477 const signed char InpQMark = 3;
4478 const signed char InpEMark = 4;
4479 const signed char InpAmp = 5;
4480 const signed char InpDash = 6;
4481 const signed char InpOpenB = 7;
4482 const signed char InpCloseB = 8;
4483 const signed char InpUnknown = 9;
4485 static const signed char mapCLT2FSMChar[] = {
4503 static const signed char table[16][10] = {
4505 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD },
4506 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD },
4507 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD },
4508 {
Lt, -1, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD },
4509 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4510 { -1, -1, Done, PInstr, Em, -1, -1, -1, -1, Elem },
4511 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4512 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4513 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4514 { -1, -1, -1, -1, -1, -1, Com, CDS, -1, -1 },
4515 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4516 {
Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD },
4517 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 },
4518 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 },
4519 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 },
4520 { CDS1, Init, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 }
4525 if (parseStack == 0 || parseStack->
isEmpty()) {
4526 contentCharDataRead =
false;
4529 state = parseStack->
pop().state;
4530 #if defined(QT_QXML_DEBUG) 4531 qDebug(
"QXmlSimpleReader: parseContent (cont) in state %d", state);
4534 ParseFunction
function = parseStack->
top().function;
4537 #if defined(QT_QXML_DEBUG) 4538 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
4541 if (!(this->*
function)()) {
4551 if (!contentCharDataRead)
4552 contentCharDataRead = parseReference_charDataRead;
4565 if (!lexicalHnd->
comment(
string())) {
4615 if (contentCharDataRead) {
4616 if (reportWhitespaceCharData || !
string().simplified().
isEmpty()) {
4643 state = table[state][input];
4652 if (!contentCharDataRead) {
4653 contentCharDataRead =
true;
4657 if (reportEntities) {
4658 if (!reportEndEntities())
4665 if (!contentCharDataRead) {
4666 contentCharDataRead =
true;
4670 if (reportEntities) {
4671 if (!reportEndEntities())
4678 if (reportEntities) {
4679 if (!reportEndEntities())
4685 if (!contentCharDataRead) {
4688 parseReference_context = InContent;
4689 if (!parseReference()) {
4694 if (reportEntities) {
4697 if (reportWhitespaceCharData || !
string().simplified().
isEmpty()) {
4706 parseReference_context = InContent;
4707 if (!parseReference()) {
4716 if (contentCharDataRead) {
4717 if (reportWhitespaceCharData || !
string().simplified().
isEmpty()) {
4725 contentCharDataRead =
false;
4730 parsePI_xmldecl =
false;
4737 if (!parseElement()) {
4747 if (!parseComment()) {
4754 if (!parseString()) {
4778 int count = (int)xmlRefStack.
count();
4779 while (count != 0 && xmlRefStack.
top().isEmpty()) {
4781 if (reportWhitespaceCharData || !
string().simplified().isEmpty()) {
4806 const signed char Init = 0;
4807 const signed char Lt = 1;
4808 const signed char Comment = 2;
4809 const signed char eatWS = 3;
4810 const signed char PInstr = 4;
4811 const signed char Comment2 = 5;
4813 const signed char InpWs = 0;
4814 const signed char InpLt = 1;
4815 const signed char InpQm = 2;
4816 const signed char InpEm = 3;
4817 const signed char InpUnknown = 4;
4819 static const signed char table[3][5] = {
4821 { eatWS,
Lt, -1, -1, -1 },
4822 { -1, -1, PInstr,
Comment, -1 },
4823 { -1, -1, -1, -1, Comment2 }
4828 if (parseStack==0 || parseStack->
isEmpty()) {
4831 state = parseStack->
pop().state;
4832 #if defined(QT_QXML_DEBUG) 4833 qDebug(
"QXmlSimpleReader: parseMisc (cont) in state %d", state);
4836 ParseFunction
function = parseStack->
top().function;
4839 #if defined(QT_QXML_DEBUG) 4840 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
4843 if (!(this->*
function)()) {
4864 if (!lexicalHnd->
comment(
string())) {
4891 state = table[state][input];
4904 parsePI_xmldecl =
false;
4914 if (!parseComment()) {
4937 const signed char Init = 0;
4938 const signed char QmI = 1;
4939 const signed char Name = 2;
4940 const signed char XMLDecl = 3;
4941 const signed char Ws1 = 4;
4942 const signed char PInstr = 5;
4943 const signed char Ws2 = 6;
4944 const signed char Version = 7;
4945 const signed char Ws3 = 8;
4946 const signed char EorSD = 9;
4947 const signed char Ws4 = 10;
4948 const signed char SD = 11;
4949 const signed char Ws5 = 12;
4950 const signed char ADone = 13;
4951 const signed char Char = 14;
4952 const signed char Qm = 15;
4953 const signed char Done = 16;
4955 const signed char InpWs = 0;
4956 const signed char InpNameBe = 1;
4957 const signed char InpGt = 2;
4958 const signed char InpQm = 3;
4959 const signed char InpUnknown = 4;
4961 static const signed char table[16][5] = {
4963 { -1, -1, -1, QmI, -1 },
4964 { -1, Name, -1, -1, -1 },
4965 { -1, -1, -1, -1, -1 },
4966 { Ws1, -1, -1, -1, -1 },
4967 { -1, Version, -1, -1, -1 },
4968 { Ws2, -1, -1, Qm, -1 },
4970 { Ws3, -1, -1, ADone, -1 },
4971 { -1, EorSD, -1, ADone, -1 },
4972 { Ws4, -1, -1, ADone, -1 },
4973 { -1, SD, -1, ADone, -1 },
4974 { Ws5, -1, -1, ADone, -1 },
4975 { -1, -1, -1, ADone, -1 },
4976 { -1, -1, Done, -1, -1 },
4983 if (parseStack==0 || parseStack->
isEmpty()) {
4986 state = parseStack->
pop().state;
4987 #if defined(QT_QXML_DEBUG) 4988 qDebug(
"QXmlSimpleReader: parsePI (cont) in state %d", state);
4991 ParseFunction
function = parseStack->
top().function;
4994 #if defined(QT_QXML_DEBUG) 4995 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
4998 if (!(this->*
function)()) {
5028 xmlVersion = string();
5042 encoding = string();
5090 state = table[state][input];
5097 parseName_useRef =
false;
5114 if (!parseAttribute()) {
5120 if (!parseAttribute()) {
5132 if (!parseAttribute()) {
5167 const signed char Init = 0;
5168 const signed char Doctype = 1;
5169 const signed char Ws1 = 2;
5170 const signed char Doctype2 = 3;
5171 const signed char Ws2 = 4;
5172 const signed char Sys = 5;
5173 const signed char Ws3 = 6;
5174 const signed char MP = 7;
5175 const signed char MPR = 8;
5176 const signed char PER = 9;
5177 const signed char Mup = 10;
5178 const signed char Ws4 = 11;
5179 const signed char MPE = 12;
5180 const signed char Done = 13;
5182 const signed char InpWs = 0;
5183 const signed char InpD = 1;
5184 const signed char InpS = 2;
5185 const signed char InpOB = 3;
5186 const signed char InpCB = 4;
5187 const signed char InpPer = 5;
5188 const signed char InpGt = 6;
5189 const signed char InpUnknown = 7;
5191 static const signed char table[13][8] = {
5193 { -1, Doctype, -1, -1, -1, -1, -1, -1 },
5194 { Ws1, -1, -1, -1, -1, -1, -1, -1 },
5195 { -1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 },
5196 { Ws2, -1, Sys, MP, -1, -1, Done, -1 },
5197 { -1, -1, Sys, MP, -1, -1, Done, -1 },
5198 { Ws3, -1, -1, MP, -1, -1, Done, -1 },
5199 { -1, -1, -1, MP, -1, -1, Done, -1 },
5200 { -1, -1, -1, -1, MPE, PER, -1, Mup },
5201 { -1, -1, -1, -1, MPE, PER, -1, Mup },
5202 { Ws4, -1, -1, -1, MPE, PER, -1, Mup },
5203 { Ws4, -1, -1, -1, MPE, PER, -1, Mup },
5204 { -1, -1, -1, -1, MPE, PER, -1, Mup },
5205 { -1, -1, -1, -1, -1, -1, Done, -1 }
5210 if (parseStack==0 || parseStack->
isEmpty()) {
5211 startDTDwasReported =
false;
5216 state = parseStack->
pop().state;
5217 #if defined(QT_QXML_DEBUG) 5218 qDebug(
"QXmlSimpleReader: parseDoctype (cont) in state %d", state);
5221 ParseFunction
function = parseStack->
top().function;
5224 #if defined(QT_QXML_DEBUG) 5225 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
5228 if (!(this->*
function)()) {
5241 if (!startDTDwasReported && lexicalHnd ) {
5242 startDTDwasReported =
true;
5243 if (!lexicalHnd->
startDTD(doctype, publicId, systemId)) {
5281 state = table[state][input];
5286 if (!parseString()) {
5301 parseName_useRef =
false;
5308 parseExternalID_allowPublicID =
false;
5309 if (!parseExternalID()) {
5313 thisPublicId = publicId;
5314 thisSystemId = systemId;
5318 if (!next_eat_ws()) {
5324 parsePEReference_context = InDTD;
5325 if (!parsePEReference()) {
5331 if (dtdRecursionLimit > 0 && parameterEntities.
size() > dtdRecursionLimit) {
5333 "DTD parsing exceeded recursion limit of %1.").arg(dtdRecursionLimit));
5336 if (!parseMarkupdecl()) {
5342 if (!next_eat_ws()) {
5349 if (!startDTDwasReported) {
5350 startDTDwasReported =
true;
5351 if (!lexicalHnd->
startDTD(doctype, publicId, systemId)) {
5356 if (!lexicalHnd->
endDTD()) {
5375 const signed char Init = 0;
5376 const signed char Sys = 1;
5377 const signed char SysWS = 2;
5378 const signed char SysSQ = 3;
5379 const signed char SysSQ2 = 4;
5380 const signed char SysDQ = 5;
5381 const signed char SysDQ2 = 6;
5382 const signed char Pub = 7;
5383 const signed char PubWS = 8;
5384 const signed char PubSQ = 9;
5385 const signed char PubSQ2 = 10;
5386 const signed char PubDQ = 11;
5387 const signed char PubDQ2 = 12;
5388 const signed char PubE = 13;
5389 const signed char PubWS2 = 14;
5390 const signed char PDone = 15;
5391 const signed char Done = 16;
5393 const signed char InpSQ = 0;
5394 const signed char InpDQ = 1;
5395 const signed char InpS = 2;
5396 const signed char InpP = 3;
5397 const signed char InpWs = 4;
5398 const signed char InpUnknown = 5;
5400 static const signed char table[15][6] = {
5402 { -1, -1, Sys, Pub, -1, -1 },
5403 { -1, -1, -1, -1, SysWS, -1 },
5404 { SysSQ, SysDQ, -1, -1, -1, -1 },
5405 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 },
5406 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 },
5407 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 },
5408 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 },
5409 { -1, -1, -1, -1, PubWS, -1 },
5410 { PubSQ, PubDQ, -1, -1, -1, -1 },
5411 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 },
5412 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 },
5413 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 },
5414 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 },
5415 { PDone, PDone, PDone, PDone, PubWS2, PDone },
5416 { SysSQ, SysDQ, PDone, PDone, PDone, PDone }
5421 if (parseStack==0 || parseStack->
isEmpty()) {
5426 state = parseStack->
pop().state;
5427 #if defined(QT_QXML_DEBUG) 5428 qDebug(
"QXmlSimpleReader: parseExternalID (cont) in state %d", state);
5431 ParseFunction
function = parseStack->
top().function;
5434 #if defined(QT_QXML_DEBUG) 5435 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
5438 if (!(this->*
function)()) {
5448 if (parseExternalID_allowPublicID) {
5449 publicId = string();
5480 state = table[state][input];
5485 if (!parseString()) {
5508 if (!parseString()) {
5533 publicId = string();
5540 systemId = string();
5553 const signed char Init = 0;
5554 const signed char Lt = 1;
5555 const signed char Em = 2;
5556 const signed char CE = 3;
5557 const signed char Qm = 4;
5558 const signed char Dash = 5;
5559 const signed char CA = 6;
5560 const signed char CEL = 7;
5561 const signed char CEN = 8;
5562 const signed char CN = 9;
5563 const signed char Done = 10;
5565 const signed char InpLt = 0;
5566 const signed char InpQm = 1;
5567 const signed char InpEm = 2;
5568 const signed char InpDash = 3;
5569 const signed char InpA = 4;
5570 const signed char InpE = 5;
5571 const signed char InpL = 6;
5572 const signed char InpN = 7;
5573 const signed char InpUnknown = 8;
5575 static const signed char table[4][9] = {
5577 {
Lt, -1, -1, -1, -1, -1, -1, -1, -1 },
5578 { -1, Qm, Em, -1, -1, -1, -1, -1, -1 },
5579 { -1, -1, -1, Dash, CA, CE, -1, CN, -1 },
5580 { -1, -1, -1, -1, -1, -1, CEL, CEN, -1 }
5585 if (parseStack==0 || parseStack->
isEmpty()) {
5588 state = parseStack->
pop().state;
5589 #if defined(QT_QXML_DEBUG) 5590 qDebug(
"QXmlSimpleReader: parseMarkupdecl (cont) in state %d", state);
5593 ParseFunction
function = parseStack->
top().function;
5596 #if defined(QT_QXML_DEBUG) 5597 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
5600 if (!(this->*
function)()) {
5619 if (!lexicalHnd->
comment(
string())) {
5664 state = table[state][input];
5677 parsePI_xmldecl =
false;
5684 if (!parseComment()) {
5690 if (!parseAttlistDecl()) {
5696 if (!parseElementDecl()) {
5702 if (!parseEntityDecl()) {
5708 if (!parseNotationDecl()) {
5723 const signed char Init = 0;
5724 const signed char Next = 1;
5725 const signed char Name = 2;
5726 const signed char NameR = 3;
5727 const signed char Done = 4;
5729 const signed char InpSemi = 0;
5730 const signed char InpPer = 1;
5731 const signed char InpUnknown = 2;
5733 static const signed char table[4][3] = {
5743 if (parseStack==0 || parseStack->
isEmpty()) {
5746 state = parseStack->
pop().state;
5747 #if defined(QT_QXML_DEBUG) 5748 qDebug(
"QXmlSimpleReader: parsePEReference (cont) in state %d", state);
5751 ParseFunction
function = parseStack->
top().function;
5754 #if defined(QT_QXML_DEBUG) 5755 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
5758 if (!(this->*
function)()) {
5773 it = parameterEntities.
find(ref());
5774 if (it != parameterEntities.
end()) {
5777 }
else if (entityRes) {
5779 it2 = externParameterEntities.
find(ref());
5781 if (it2 != externParameterEntities.
end()) {
5782 if (!entityRes->
resolveEntity((*it2).publicId, (*it2).systemId, ret)) {
5788 xmlRefString = ret->
data();
5807 if (parsePEReference_context == InEntityValue) {
5809 if (!insertXmlRef(xmlRefString, ref(),
true))
5811 }
else if (parsePEReference_context == InDTD) {
5839 state = table[state][input];
5847 parseName_useRef =
true;
5869 const signed char Init = 0;
5870 const signed char Attlist = 1;
5871 const signed char Ws = 2;
5872 const signed char Name = 3;
5873 const signed char Ws1 = 4;
5874 const signed char Attdef = 5;
5875 const signed char Ws2 = 6;
5876 const signed char Atttype = 7;
5877 const signed char Ws3 = 8;
5878 const signed char DDecH = 9;
5879 const signed char DefReq = 10;
5880 const signed char DefImp = 11;
5881 const signed char DefFix = 12;
5882 const signed char Attval = 13;
5883 const signed char Ws4 = 14;
5884 const signed char Done = 15;
5886 const signed char InpWs = 0;
5887 const signed char InpGt = 1;
5888 const signed char InpHash = 2;
5889 const signed char InpA = 3;
5890 const signed char InpI = 4;
5891 const signed char InpF = 5;
5892 const signed char InpR = 6;
5893 const signed char InpUnknown = 7;
5895 static const signed char table[15][8] = {
5897 { -1, -1, -1, Attlist, -1, -1, -1, -1 },
5898 { Ws, -1, -1, -1, -1, -1, -1, -1 },
5899 { -1, -1, -1, Name, Name, Name, Name, Name },
5900 { Ws1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef },
5901 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef },
5902 { Ws2, -1, -1, -1, -1, -1, -1, -1 },
5903 { -1, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype },
5904 { Ws3, -1, -1, -1, -1, -1, -1, -1 },
5905 { -1, Attval, DDecH, Attval, Attval, Attval, Attval, Attval },
5906 { -1, -1, -1, -1, DefImp, DefFix, DefReq, -1 },
5907 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 },
5908 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 },
5909 { Ws3, -1, -1, -1, -1, -1, -1, -1 },
5910 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 },
5911 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }
5916 if (parseStack==0 || parseStack->
isEmpty()) {
5919 state = parseStack->
pop().state;
5920 #if defined(QT_QXML_DEBUG) 5921 qDebug(
"QXmlSimpleReader: parseAttlistDecl (cont) in state %d", state);
5924 ParseFunction
function = parseStack->
top().function;
5927 #if defined(QT_QXML_DEBUG) 5928 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
5931 if (!(this->*
function)()) {
5941 attDeclEName =
name();
5944 attDeclAName =
name();
5975 state = table[state][input];
5980 if (!parseString()) {
5995 parseName_useRef =
false;
6002 parseName_useRef =
false;
6009 if (!parseAttType()) {
6019 if (!parseString()) {
6026 if (!parseString()) {
6033 if (!parseString()) {
6039 if (!parseAttValue()) {
6070 const signed char Init = 0;
6071 const signed char ST = 1;
6072 const signed char TTI = 2;
6073 const signed char TTI2 = 3;
6074 const signed char TTI3 = 4;
6075 const signed char TTE = 5;
6076 const signed char TTEY = 6;
6077 const signed char TTEI = 7;
6078 const signed char N = 8;
6079 const signed char TTNM = 9;
6080 const signed char TTNM2 = 10;
6081 const signed char NO = 11;
6082 const signed char NO2 = 12;
6083 const signed char NO3 = 13;
6084 const signed char NOName = 14;
6085 const signed char NO4 = 15;
6086 const signed char EN = 16;
6087 const signed char ENNmt = 17;
6088 const signed char EN2 = 18;
6089 const signed char ADone = 19;
6090 const signed char Done = 20;
6092 const signed char InpWs = 0;
6093 const signed char InpOp = 1;
6094 const signed char InpCp = 2;
6095 const signed char InpPipe = 3;
6096 const signed char InpC = 4;
6097 const signed char InpE = 5;
6098 const signed char InpI = 6;
6099 const signed char InpM = 7;
6100 const signed char InpN = 8;
6101 const signed char InpO = 9;
6102 const signed char InpR = 10;
6103 const signed char InpS = 11;
6104 const signed char InpY = 12;
6105 const signed char InpUnknown = 13;
6107 static const signed char table[19][14] = {
6109 { -1, EN, -1, -1, ST, TTE, TTI, -1, N, -1, -1, -1, -1, -1 },
6110 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done },
6111 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI2, Done, Done, Done },
6112 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI3, Done, Done },
6113 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done },
6114 { -1, -1, -1, -1, -1, -1, TTEI, -1, -1, -1, -1, -1, TTEY, -1 },
6115 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done },
6116 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done },
6117 { -1, -1, -1, -1, -1, -1, -1, TTNM, -1, NO, -1, -1, -1, -1 },
6118 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTNM2, Done, Done },
6119 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done },
6120 { NO2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6121 { -1, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6122 { NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName },
6123 { NO4, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6124 { -1, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6125 { -1, -1, ENNmt, -1, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt },
6126 { EN2, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6127 { -1, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }
6132 if (parseStack==0 || parseStack->
isEmpty()) {
6135 state = parseStack->
pop().state;
6136 #if defined(QT_QXML_DEBUG) 6137 qDebug(
"QXmlSimpleReader: parseAttType (cont) in state %d", state);
6140 ParseFunction
function = parseStack->
top().function;
6143 #if defined(QT_QXML_DEBUG) 6144 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
6147 if (!(this->*
function)()) {
6199 state = table[state][input];
6204 if (!parseString()) {
6211 if (!parseString()) {
6218 if (!parseString()) {
6228 if (!parseString()) {
6238 if (!parseString()) {
6248 if (!parseString()) {
6258 if (!parseString()) {
6270 if (!next_eat_ws()) {
6276 parseName_useRef =
false;
6289 if (!next_eat_ws()) {
6295 if (!parseNmtoken()) {
6325 const signed char Init = 0;
6326 const signed char Dq = 1;
6327 const signed char DqRef = 2;
6328 const signed char DqC = 3;
6329 const signed char Sq = 4;
6330 const signed char SqRef = 5;
6331 const signed char SqC = 6;
6332 const signed char Done = 7;
6334 const signed char InpDq = 0;
6335 const signed char InpSq = 1;
6336 const signed char InpAmp = 2;
6337 const signed char InpLt = 3;
6338 const signed char InpUnknown = 4;
6340 static const signed char table[7][5] = {
6342 { Dq, Sq, -1, -1, -1 },
6343 { Done, DqC, DqRef, -1, DqC },
6344 { Done, DqC, DqRef, -1, DqC },
6345 { Done, DqC, DqRef, -1, DqC },
6346 { SqC, Done, SqRef, -1, SqC },
6347 { SqC, Done, SqRef, -1, SqC },
6348 { SqC, Done, SqRef, -1, SqC }
6353 if (parseStack==0 || parseStack->
isEmpty()) {
6356 state = parseStack->
pop().state;
6357 #if defined(QT_QXML_DEBUG) 6358 qDebug(
"QXmlSimpleReader: parseAttValue (cont) in state %d", state);
6361 ParseFunction
function = parseStack->
top().function;
6364 #if defined(QT_QXML_DEBUG) 6365 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
6368 if (!(this->*
function)()) {
6400 state = table[state][input];
6410 parseReference_context = InAttributeValue;
6411 if (!parseReference()) {
6437 const signed char Init = 0;
6438 const signed char Elem = 1;
6439 const signed char Ws1 = 2;
6440 const signed char Nam = 3;
6441 const signed char Ws2 = 4;
6442 const signed char Empty = 5;
6443 const signed char Any = 6;
6444 const signed char Cont = 7;
6445 const signed char Mix = 8;
6446 const signed char Mix2 = 9;
6447 const signed char Mix3 = 10;
6448 const signed char MixN1 = 11;
6449 const signed char MixN2 = 12;
6450 const signed char MixN3 = 13;
6451 const signed char MixN4 = 14;
6452 const signed char Cp = 15;
6453 const signed char Cp2 = 16;
6454 const signed char WsD = 17;
6455 const signed char Done = 18;
6457 const signed char InpWs = 0;
6458 const signed char InpGt = 1;
6459 const signed char InpPipe = 2;
6460 const signed char InpOp = 3;
6461 const signed char InpCp = 4;
6462 const signed char InpHash = 5;
6463 const signed char InpQm = 6;
6464 const signed char InpAst = 7;
6465 const signed char InpPlus = 8;
6466 const signed char InpA = 9;
6467 const signed char InpE = 10;
6468 const signed char InpL = 11;
6469 const signed char InpUnknown = 12;
6471 static const signed char table[18][13] = {
6473 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Elem, -1 },
6474 { Ws1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6475 { -1, -1, -1, -1, -1, -1, -1, -1, -1, Nam, Nam, Nam, Nam },
6476 { Ws2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6477 { -1, -1, -1, Cont, -1, -1, -1, -1, -1, Any, Empty, -1, -1 },
6478 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6479 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6480 { -1, -1, -1, Cp, Cp, Mix, -1, -1, -1, Cp, Cp, Cp, Cp },
6481 { Mix2, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 },
6482 { -1, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 },
6483 { WsD, Done, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 },
6484 { -1, -1, -1, -1, -1, -1, -1, -1, -1, MixN2, MixN2, MixN2, MixN2 },
6485 { MixN3, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 },
6486 { -1, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 },
6487 { -1, -1, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 },
6488 { WsD, Done, -1, -1, -1, -1, Cp2, Cp2, Cp2, -1, -1, -1, -1 },
6489 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
6490 { -1, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }
6495 if (parseStack==0 || parseStack->
isEmpty()) {
6498 state = parseStack->
pop().state;
6499 #if defined(QT_QXML_DEBUG) 6500 qDebug(
"QXmlSimpleReader: parseElementDecl (cont) in state %d", state);
6503 ParseFunction
function = parseStack->
top().function;
6506 #if defined(QT_QXML_DEBUG) 6507 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
6510 if (!(this->*
function)()) {
6557 state = table[state][input];
6562 if (!parseString()) {
6574 parseName_useRef =
false;
6588 if (!parseString()) {
6595 if (!parseString()) {
6601 if (!next_eat_ws()) {
6608 if (!parseString()) {
6623 if (!next_eat_ws()) {
6629 parseName_useRef =
false;
6645 if (!parseChoiceSeq()) {
6654 if (!next_eat_ws()) {
6675 const signed char Init = 0;
6676 const signed char Not = 1;
6677 const signed char Ws1 = 2;
6678 const signed char Nam = 3;
6679 const signed char Ws2 = 4;
6680 const signed char ExtID = 5;
6681 const signed char ExtIDR = 6;
6682 const signed char Ws3 = 7;
6683 const signed char Done = 8;
6685 const signed char InpWs = 0;
6686 const signed char InpGt = 1;
6687 const signed char InpN = 2;
6688 const signed char InpUnknown = 3;
6690 static const signed char table[8][4] = {
6692 { -1, -1, Not, -1 },
6693 { Ws1, -1, -1, -1 },
6694 { -1, -1, Nam, Nam },
6695 { Ws2, Done, -1, -1 },
6696 { -1, Done, ExtID, ExtID },
6697 { Ws3, Done, -1, -1 },
6698 { Ws3, Done, -1, -1 },
6699 { -1, Done, -1, -1 }
6704 if (parseStack==0 || parseStack->
isEmpty()) {
6707 state = parseStack->
pop().state;
6708 #if defined(QT_QXML_DEBUG) 6709 qDebug(
"QXmlSimpleReader: parseNotationDecl (cont) in state %d", state);
6712 ParseFunction
function = parseStack->
top().function;
6715 #if defined(QT_QXML_DEBUG) 6716 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
6719 if (!(this->*
function)()) {
6731 if (!dtdHnd->
notationDecl(name(), publicId, systemId)) {
6759 state = table[state][input];
6764 if (!parseString()) {
6776 parseName_useRef =
false;
6790 parseExternalID_allowPublicID =
true;
6791 if (!parseExternalID()) {
6818 const signed char Init = 0;
6819 const signed char Ws1 = 1;
6820 const signed char CoS = 2;
6821 const signed char Ws2 = 3;
6822 const signed char More = 4;
6823 const signed char Name = 5;
6824 const signed char Done = 6;
6826 const signed char InpWs = 0;
6827 const signed char InpOp = 1;
6828 const signed char InpCp = 2;
6829 const signed char InpQm = 3;
6830 const signed char InpAst = 4;
6831 const signed char InpPlus = 5;
6832 const signed char InpPipe = 6;
6833 const signed char InpComm = 7;
6834 const signed char InpUnknown = 8;
6836 static const signed char table[6][9] = {
6838 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name },
6839 { -1, CoS, -1, -1, -1, -1, -1, -1, CoS },
6840 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 },
6841 { -1, -1, Done, -1, -1, -1, More, More, -1 },
6842 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name },
6843 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 }
6848 if (parseStack==0 || parseStack->
isEmpty()) {
6851 state = parseStack->
pop().state;
6852 #if defined(QT_QXML_DEBUG) 6853 qDebug(
"QXmlSimpleReader: parseChoiceSeq (cont) in state %d", state);
6856 ParseFunction
function = parseStack->
top().function;
6859 #if defined(QT_QXML_DEBUG) 6860 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
6863 if (!(this->*
function)()) {
6903 state = table[state][input];
6907 if (!next_eat_ws()) {
6913 if (!parseChoiceSeq()) {
6919 if (!next_eat_ws()) {
6925 if (!next_eat_ws()) {
6931 parseName_useRef =
false;
6953 const QString &toSearch = toSearchIt.key();
6956 if (!literalEntitySizes.
contains(toSearch)) {
6961 referencedIt != entities.
constEnd();
6963 const QString &entityName = referencedIt.key();
6965 for (
int i = 0; i < leftOvers.
size() && i != -1; ) {
6968 i = leftOvers.
indexOf(entityNameBuffer, i);
6972 ++referencesToOtherEntities[toSearch][entityName];
6976 literalEntitySizes[toSearch] = leftOvers.
size();
6981 entityIt != referencesToOtherEntities.
constEnd();
6983 const QString &entity = entityIt.key();
6986 if (expandedIt == expandedSizes.
end()) {
6987 expandedIt = expandedSizes.
insert(entity, literalEntitySizes.
value(entity));
6989 referenceIt != entityIt->constEnd();
6991 const QString &referenceTo = referenceIt.key();
6992 const int references = referencesToOtherEntities.
value(entity).value(referenceTo);
6994 *expandedIt += expandedSizes.
value(referenceTo) * references + literalEntitySizes.
value(referenceTo) * references;
6997 if (*expandedIt > entityCharacterLimit) {
6999 *errorMessage =
QString::fromLatin1(
"The XML entity \"%1\" expands to a string that is too large to process (%2 characters > %3).")
7000 .
arg(entity, *expandedIt, entityCharacterLimit);
7017 const signed char Init = 0;
7018 const signed char Ent = 1;
7019 const signed char Ws1 = 2;
7020 const signed char Name = 3;
7021 const signed char Ws2 = 4;
7022 const signed char EValue = 5;
7023 const signed char EValueR = 6;
7024 const signed char ExtID = 7;
7025 const signed char Ws3 = 8;
7026 const signed char Ndata = 9;
7027 const signed char Ws4 = 10;
7028 const signed char NNam = 11;
7029 const signed char NNamR = 12;
7030 const signed char PEDec = 13;
7031 const signed char Ws6 = 14;
7032 const signed char PENam = 15;
7033 const signed char Ws7 = 16;
7034 const signed char PEVal = 17;
7035 const signed char PEValR = 18;
7036 const signed char PEEID = 19;
7037 const signed char PEEIDR = 20;
7038 const signed char WsE = 21;
7039 const signed char Done = 22;
7040 const signed char EDDone = 23;
7042 const signed char InpWs = 0;
7043 const signed char InpPer = 1;
7044 const signed char InpQuot = 2;
7045 const signed char InpGt = 3;
7046 const signed char InpN = 4;
7047 const signed char InpUnknown = 5;
7049 static const signed char table[22][6] = {
7051 { -1, -1, -1, -1, Ent, -1 },
7052 { Ws1, -1, -1, -1, -1, -1 },
7053 { -1, PEDec, -1, -1, Name, Name },
7054 { Ws2, -1, -1, -1, -1, -1 },
7055 { -1, -1, EValue, -1, -1, ExtID },
7056 { WsE, -1, -1, Done, -1, -1 },
7057 { WsE, -1, -1, Done, -1, -1 },
7058 { Ws3, -1, -1, EDDone,-1, -1 },
7059 { -1, -1, -1, EDDone,Ndata, -1 },
7060 { Ws4, -1, -1, -1, -1, -1 },
7061 { -1, -1, -1, -1, NNam, NNam },
7062 { WsE, -1, -1, Done, -1, -1 },
7063 { WsE, -1, -1, Done, -1, -1 },
7064 { Ws6, -1, -1, -1, -1, -1 },
7065 { -1, -1, -1, -1, PENam, PENam },
7066 { Ws7, -1, -1, -1, -1, -1 },
7067 { -1, -1, PEVal, -1, -1, PEEID },
7068 { WsE, -1, -1, Done, -1, -1 },
7069 { WsE, -1, -1, Done, -1, -1 },
7070 { WsE, -1, -1, Done, -1, -1 },
7071 { WsE, -1, -1, Done, -1, -1 },
7072 { -1, -1, -1, Done, -1, -1 }
7077 if (parseStack==0 || parseStack->
isEmpty()) {
7080 state = parseStack->
pop().state;
7081 #if defined(QT_QXML_DEBUG) 7082 qDebug(
"QXmlSimpleReader: parseEntityDecl (cont) in state %d", state);
7085 ParseFunction
function = parseStack->
top().function;
7088 #if defined(QT_QXML_DEBUG) 7089 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7092 if (!(this->*
function)()) {
7102 if ( !entityExist(
name())) {
7104 if (isExpandedEntityValueTooLarge(&errorMessage)) {
7105 reportParseError(errorMessage);
7120 if ( !entityExist(
name())) {
7132 if ( !entityExist(
name())) {
7144 if ( !entityExist(
name())) {
7156 if ( !entityExist(
name())) {
7191 state = table[state][input];
7196 if (!parseString()) {
7208 parseName_useRef =
false;
7222 if (!parseEntityValue()) {
7228 parseExternalID_allowPublicID =
false;
7229 if (!parseExternalID()) {
7242 if (!parseString()) {
7255 parseName_useRef =
true;
7271 parseName_useRef =
false;
7285 if (!parseEntityValue()) {
7292 parseExternalID_allowPublicID =
false;
7293 if (!parseExternalID()) {
7320 const signed char Init = 0;
7321 const signed char Dq = 1;
7322 const signed char DqC = 2;
7323 const signed char DqPER = 3;
7324 const signed char DqRef = 4;
7325 const signed char Sq = 5;
7326 const signed char SqC = 6;
7327 const signed char SqPER = 7;
7328 const signed char SqRef = 8;
7329 const signed char Done = 9;
7331 const signed char InpDq = 0;
7332 const signed char InpSq = 1;
7333 const signed char InpAmp = 2;
7334 const signed char InpPer = 3;
7335 const signed char InpUnknown = 4;
7337 static const signed char table[9][5] = {
7339 { Dq, Sq, -1, -1, -1 },
7340 { Done, DqC, DqRef, DqPER, DqC },
7341 { Done, DqC, DqRef, DqPER, DqC },
7342 { Done, DqC, DqRef, DqPER, DqC },
7343 { Done, DqC, DqRef, DqPER, DqC },
7344 { SqC, Done, SqRef, SqPER, SqC },
7345 { SqC, Done, SqRef, SqPER, SqC },
7346 { SqC, Done, SqRef, SqPER, SqC },
7347 { SqC, Done, SqRef, SqPER, SqC }
7352 if (parseStack==0 || parseStack->
isEmpty()) {
7355 state = parseStack->
pop().state;
7356 #if defined(QT_QXML_DEBUG) 7357 qDebug(
"QXmlSimpleReader: parseEntityValue (cont) in state %d", state);
7360 ParseFunction
function = parseStack->
top().function;
7363 #if defined(QT_QXML_DEBUG) 7364 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7367 if (!(this->*
function)()) {
7399 state = table[state][input];
7414 parsePEReference_context = InEntityValue;
7415 if (!parsePEReference()) {
7422 parseReference_context = InEntityValue;
7423 if (!parseReference()) {
7447 const signed char Init = 0;
7448 const signed char Dash1 = 1;
7449 const signed char Dash2 = 2;
7450 const signed char Com = 3;
7451 const signed char Com2 = 4;
7452 const signed char ComE = 5;
7453 const signed char Done = 6;
7455 const signed char InpDash = 0;
7456 const signed char InpGt = 1;
7457 const signed char InpUnknown = 2;
7459 static const signed char table[6][3] = {
7471 if (parseStack==0 || parseStack->
isEmpty()) {
7474 state = parseStack->
pop().state;
7475 #if defined(QT_QXML_DEBUG) 7476 qDebug(
"QXmlSimpleReader: parseComment (cont) in state %d", state);
7479 ParseFunction
function = parseStack->
top().function;
7482 #if defined(QT_QXML_DEBUG) 7483 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7486 if (!(this->*
function)()) {
7522 state = table[state][input];
7562 const int PName = 1;
7565 const int Quotes = 4;
7567 const int InpNameBe = 0;
7568 const int InpEq = 1;
7569 const int InpDq = 2;
7570 const int InpSq = 3;
7571 const int InpUnknown = 4;
7573 static const int table[4][5] = {
7575 { PName, -1, -1, -1, -1 },
7576 { -1, Eq, -1, -1, Ws },
7577 { -1, Eq, -1, -1, -1 },
7578 { -1, -1, Quotes, Quotes, -1 }
7583 if (parseStack==0 || parseStack->
isEmpty()) {
7586 state = parseStack->
pop().state;
7587 #if defined(QT_QXML_DEBUG) 7588 qDebug(
"QXmlSimpleReader: parseAttribute (cont) in state %d", state);
7591 ParseFunction
function = parseStack->
top().function;
7594 #if defined(QT_QXML_DEBUG) 7595 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7598 if (!(this->*
function)()) {
7631 state = table[state][input];
7635 parseName_useRef =
false;
7648 if (!next_eat_ws()) {
7654 if (!parseAttValue()) {
7670 const int Name1 = 1;
7674 static const int table[3][3] = {
7677 { Name, Name, Done },
7678 { Name, Name, Done }
7682 if (parseStack==0 || parseStack->
isEmpty()) {
7685 state = parseStack->
pop().state;
7686 #if defined(QT_QXML_DEBUG) 7687 qDebug(
"QXmlSimpleReader: parseName (cont) in state %d", state);
7690 ParseFunction
function = parseStack->
top().function;
7693 #if defined(QT_QXML_DEBUG) 7694 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7697 if (!(this->*
function)()) {
7724 if (parseName_useRef) {
7734 if (parseName_useRef) {
7751 const signed char Init = 0;
7752 const signed char NameF = 1;
7753 const signed char Name = 2;
7754 const signed char Done = 3;
7756 const signed char InpNameCh = 0;
7757 const signed char InpUnknown = 1;
7759 static const signed char table[3][2] = {
7768 if (parseStack==0 || parseStack->
isEmpty()) {
7771 state = parseStack->
pop().state;
7772 #if defined(QT_QXML_DEBUG) 7773 qDebug(
"QXmlSimpleReader: parseNmtoken (cont) in state %d", state);
7776 ParseFunction
function = parseStack->
top().function;
7779 #if defined(QT_QXML_DEBUG) 7780 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7783 if (!(this->*
function)()) {
7809 state = table[state][input];
7844 const signed char Init = 0;
7845 const signed char SRef = 1;
7846 const signed char ChRef = 2;
7847 const signed char ChDec = 3;
7848 const signed char ChHexS = 4;
7849 const signed char ChHex = 5;
7850 const signed char Name = 6;
7851 const signed char DoneD = 7;
7852 const signed char DoneH = 8;
7853 const signed char DoneN = 9;
7855 const signed char InpAmp = 0;
7856 const signed char InpSemi = 1;
7857 const signed char InpHash = 2;
7858 const signed char InpX = 3;
7859 const signed char InpNum = 4;
7860 const signed char InpHex = 5;
7861 const signed char InpUnknown = 6;
7863 static const signed char table[8][7] = {
7865 { SRef, -1, -1, -1, -1, -1, -1 },
7866 { -1, -1, ChRef, Name, Name, Name, Name },
7867 { -1, -1, -1, ChHexS, ChDec, -1, -1 },
7868 { -1, DoneD, -1, -1, ChDec, -1, -1 },
7869 { -1, -1, -1, -1, ChHex, ChHex, -1 },
7870 { -1, DoneH, -1, -1, ChHex, ChHex, -1 },
7871 { -1, DoneN, -1, -1, -1, -1, -1 }
7876 if (parseStack==0 || parseStack->
isEmpty()) {
7877 parseReference_charDataRead =
false;
7880 state = parseStack->
pop().state;
7881 #if defined(QT_QXML_DEBUG) 7882 qDebug(
"QXmlSimpleReader: parseReference (cont) in state %d", state);
7885 ParseFunction
function = parseStack->
top().function;
7888 #if defined(QT_QXML_DEBUG) 7889 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
7892 if (!(this->*
function)()) {
7919 }
else if (c.
cell() ==
'&') {
7921 }
else if (c.
cell() ==
';') {
7923 }
else if (c.
cell() ==
'#') {
7925 }
else if (c.
cell() ==
'x') {
7927 }
else if (
'0' <= c.
cell() && c.
cell() <=
'9') {
7929 }
else if (
'a' <= c.
cell() && c.
cell() <=
'f') {
7931 }
else if (
'A' <= c.
cell() && c.
cell() <=
'F') {
7936 state = table[state][input];
7959 parseName_useRef =
true;
7966 tmp = ref().
toUInt(&ok, 10);
7968 stringAddC(
QChar(tmp));
7973 parseReference_charDataRead =
true;
7977 tmp = ref().
toUInt(&ok, 16);
7979 stringAddC(
QChar(tmp));
7984 parseReference_charDataRead =
true;
7988 if (!processReference())
8004 if (parseReference_context == InEntityValue) {
8011 parseReference_charDataRead =
true;
8013 if (parseReference_context == InEntityValue) {
8020 parseReference_charDataRead =
true;
8022 if (parseReference_context == InEntityValue) {
8029 parseReference_charDataRead =
true;
8031 if (parseReference_context == InEntityValue) {
8038 parseReference_charDataRead =
true;
8040 if (parseReference_context == InEntityValue) {
8047 parseReference_charDataRead =
true;
8050 it = entities.
find(reference);
8051 if (it != entities.
end()) {
8053 switch (parseReference_context) {
8056 if (!insertXmlRef(*it, reference,
false))
8058 parseReference_charDataRead =
false;
8060 case InAttributeValue:
8062 if (!insertXmlRef(*it, reference,
true))
8064 parseReference_charDataRead =
false;
8070 for (
int i=0; i<(int)reference.
length(); i++) {
8071 stringAddC(reference[i]);
8074 parseReference_charDataRead =
true;
8079 parseReference_charDataRead =
false;
8085 itExtern = externEntities.
find(reference);
8086 if (itExtern == externEntities.
end()) {
8089 if (parseReference_context == InEntityValue) {
8092 for (
int i=0; i<(int)reference.
length(); i++) {
8093 stringAddC(reference[i]);
8096 parseReference_charDataRead =
true;
8099 if (parseReference_context == InContent) {
8100 if (contentCharDataRead) {
8101 if (reportWhitespaceCharData || !
string().simplified().
isEmpty()) {
8102 if (contentHnd != 0 && !contentHnd->
characters(
string())) {
8108 contentCharDataRead =
false;
8122 }
else if ((*itExtern).notation.isNull()) {
8124 switch (parseReference_context) {
8131 if (!entityRes->
resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)) {
8139 while (buffer.
length()>0){
8140 xmlRefString += buffer;
8142 buffer = ret->
data();
8149 if (!insertXmlRef(xmlRefString, reference,
false))
8154 if (skipIt && contentHnd) {
8163 parseReference_charDataRead =
false;
8165 case InAttributeValue:
8167 parseReference_charDataRead =
false;
8174 for (
int i=0; i<(int)reference.
length(); i++) {
8175 stringAddC(reference[i]);
8178 parseReference_charDataRead =
true;
8183 parseReference_charDataRead =
false;
8191 parseReference_charDataRead =
false;
8209 const signed char InpCharExpected = 0;
8210 const signed char InpUnknown = 1;
8215 if (parseStack==0 || parseStack->
isEmpty()) {
8216 Done = parseString_s.
length();
8219 state = parseStack->
pop().state;
8220 #if defined(QT_QXML_DEBUG) 8221 qDebug(
"QXmlSimpleReader: parseString (cont) in state %d", state);
8224 ParseFunction
function = parseStack->
top().function;
8227 #if defined(QT_QXML_DEBUG) 8228 qDebug(
"QXmlSimpleReader: eat_ws (cont)");
8231 if (!(this->*
function)()) {
8239 if (state == Done) {
8247 if (c == parseString_s[(
int)state]) {
8248 input = InpCharExpected;
8252 if (input == InpCharExpected) {
8283 if (xmlRefStack.
count() > n+1) {
8288 if (reportEntities && lexicalHnd) {
8302 int count = xmlRefStack.
size();
8303 while (count != 0) {
8304 if (xmlRefStack.
top().isEmpty()) {
8308 c = xmlRefStack.
top().next();
8316 c = inputSource->
next();
8319 if (c == QXmlInputSource::EndOfData && parseStack == 0)
8320 c = inputSource->
next();
8324 }
else if (uc ==
'\r') {
8351 if (parseStack != 0) {
8376 externParameterEntities.
clear();
8377 parameterEntities.
clear();
8378 externEntities.
clear();
8397 xmlRefStack.
clear();
8407 if ( parameterEntities.
find(e) == parameterEntities.
end() &&
8408 externParameterEntities.
find(e) == externParameterEntities.
end() &&
8409 externEntities.
find(e) == externEntities.
end() &&
8410 entities.
find(e) == entities.
end()) {
8419 this->error =
error;
8421 if (this->error.
isNull()) {
8423 thisPublicId, thisSystemId);
8427 thisPublicId, thisSystemId);
8441 if (parseStack == 0) {
8444 if (c == QXmlInputSource::EndOfDocument) {
8447 pushParseState(where, state);
8461 if (parseStack!=0 && error.
isNull()) {
8462 pushParseState(where, state);
8478 parseStack->
push(ps);
8483 value.
resize(valueLen + arrayPos);
8484 memcpy(value.
data() + valueLen, array, arrayPos *
sizeof(
QChar));
8485 valueLen += arrayPos;
8492 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
8497 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
8502 updateValue(refValue, refArray, refArrayPos, refValueLen);
8508 if (stringArrayPos == 256)
8509 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
8510 stringArray[stringArrayPos++] = ch;
8514 if (nameArrayPos == 256)
8515 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
8516 nameArray[nameArrayPos++] = ch;
8520 if (refArrayPos == 256)
8521 updateValue(refValue, refArray, refArrayPos, refValueLen);
8522 refArray[refArrayPos++] = ch;
void * property(const QString &name, bool *ok=0) const
Reimplemented Function
static const signed char cltLt
void reset()
Resets this namespace support object ready for reuse.
void processName(const QString &, bool, QString &, QString &) const
Processes a raw XML 1.0 name in the current context by removing the prefix and looking it up among th...
void setDeclHandler(QXmlDeclHandler *handler)
Reimplemented Function
void popContext()
Reverts to the previous namespace context.
QStack< ParseState > * parseStack
static NameChar determineNameChar(QChar ch)
The QXmlLocator class provides the XML handler classes with information about the parsing position wi...
#define Q_DUMMY_COMPARISON_OPERATOR(C)
QMap< QString, QString > entities
bool parseBeginOrContinue(int state, bool incremental)
Category
This enum maps the Unicode character categories.
static bool stripTextDecl(QString &str)
The QXmlLexicalHandler class provides an interface to report the lexical content of XML data...
virtual bool skippedEntity(const QString &name)=0
Some readers may skip entities if they have not seen the declarations (e.
bool endPrefixMapping(const QString &prefix)
This reimplementation does nothing.
#define QT_END_NAMESPACE
This macro expands to.
virtual QString errorString() const =0
The reader calls this function to get an error string if any of the handler functions returns false...
QString value(int index) const
Returns an attribute's value for the attribute at position index.
QString localName(int index) const
Looks up an attribute's local name for the attribute at position index.
bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName)
This reimplementation does nothing.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
#define XMLERR_UNEXPECTEDCHARACTER
bool processElementAttribute()
virtual bool waitForReadyRead(int msecs)
Blocks until new data is available for reading and the readyRead() signal has been emitted...
char * data()
Returns a pointer to the data stored in the byte array.
const QChar at(int i) const
Returns the character at the given index position in the string.
virtual ~QXmlSimpleReader()
Destroys the simple XML reader.
virtual QString errorString() const =0
The reader calls this function to get an error string if any of the handler functions returns false...
virtual bool parseContinue()
Continues incremental parsing, taking input from the QXmlInputSource that was specified with the most...
The QRegExp class provides pattern matching using regular expressions.
QXmlNamespaceSupport()
Constructs a QXmlNamespaceSupport.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QXmlSimpleReader()
Constructs a simple XML reader.
bool processElementEmptyTag()
#define it(className, varName)
QString type(int index) const
Looks up an attribute's type for the attribute at position index.
int count(const T &t) const
Returns the number of occurrences of value in the vector.
bool hasFeature(const QString &name) const
Reimplemented Function
static const signed char cltEm
#define XMLERR_ERRORPARSINGDOCTYPE
int index(const QString &qName) const
Looks up the index of an attribute by the qualified name qName.
QXmlParseExceptionPrivate(const QXmlParseExceptionPrivate &other)
ExternEntity(const QString &p, const QString &s, const QString &n)
QString & replace(int i, int len, QChar after)
The QByteArray class provides an array of bytes.
bool notationDecl(const QString &name, const QString &publicId, const QString &systemId)
This reimplementation does nothing.
int length() const
Returns the number of characters in this string.
The QTextDecoder class provides a state-based decoder.
bool parse(const QXmlInputSource &input)
Reimplemented Function
static const signed char cltSlash
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
static const signed char cltOB
int count(const Key &key) const
Returns the number of items associated with key key.
int size() const
Returns the number of (key, value) pairs in the map.
static const signed char cltWS
~QXmlSimpleReaderLocator()
static const char nameCharTable[128]
The QXmlNamespaceSupport class is a helper class for XML readers which want to include namespace supp...
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)
#define XMLERR_TAGMISMATCH
QTextDecoder * makeDecoder() const
Creates a QTextDecoder which stores enough state to decode chunks of char * data to create chunks of ...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define XMLERR_VERSIONEXPECTED
#define XMLERR_ERRORPARSINGELEMENT
QXmlLexicalHandler * lexicalHnd
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)=0
The reader calls this function when it has parsed a start element tag.
#define XMLERR_INTERNALGENERALENTITYINDTD
bool hasProperty(const QString &name) const
Reimplemented Function
QXmlParseException(const QString &name=QString(), int c=-1, int l=-1, const QString &p=QString(), const QString &s=QString())
Constructs a parse exception with the error string name for column c and line l for the public identi...
The QString class provides a Unicode character string.
void setProperty(const QString &name, void *value)
Reimplemented Function
bool skippedEntity(const QString &name)
This reimplementation does nothing.
QXmlLexicalHandler * lexicalHandler() const
Reimplemented Function
int count() const
Returns the number of attributes in the list.
void setErrorHandler(QXmlErrorHandler *handler)
Reimplemented Function
virtual bool startDTD(const QString &name, const QString &publicId, const QString &systemId)=0
The reader calls this function to report the start of a DTD declaration, if any.
QStringList prefixes() const
Returns a list of all the prefixes currently declared.
bool endCDATA()
This reimplementation does nothing.
The QXmlErrorHandler class provides an interface to report errors in XML data.
static QString extractEncodingDecl(const QString &text, bool *needMoreText)
bool reportWhitespaceCharData
#define XMLERR_MORETHANONEDOCTYPE
The QXmlDTDHandler class provides an interface to report DTD content of XML data. ...
QScopedPointer< QXmlSimpleReaderPrivate > d_ptr
static const signed char cltQm
#define XMLERR_UNPARSEDENTITYREFERENCE
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
#define XMLERR_SDDECLEXPECTED
QXmlSimpleReader * reader
The QChar class provides a 16-bit Unicode character.
QChar * data()
Returns a pointer to the data stored in the QString.
int columnNumber() const
Returns the column number (starting at 1) or -1 if there is no column number available.
const T value(const Key &key) const
Returns the value associated with the key.
bool insertXmlRef(const QString &, const QString &, bool)
bool parseExternalID_allowPublicID
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Category category() const
Returns the character's category.
iterator Iterator
Qt-style synonym for QList::iterator.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void setLexicalHandler(QXmlLexicalHandler *handler)
Reimplemented Function
bool qt_xml_skipped_entity_in_content
static const signed char cltAmp
void unexpectedEof(ParseFunction where, int state)
static const signed char cltSq
void parseFailed(ParseFunction where, int state)
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
T pop()
Removes the top item from the stack and returns it.
void pop_back()
This function is provided for STL compatibility.
Q_CORE_EXPORT void qDebug(const char *,...)
bool characters(const QString &ch)
This reimplementation does nothing.
The QXmlSimpleReader class provides an implementation of a simple XML parser.
bool startEntity(const QString &name)
This reimplementation does nothing.
void append(const T &t)
Inserts value at the end of the list.
void pushParseState(ParseFunction function, int state)
static const signed char cltUnknown
#define XMLERR_LETTEREXPECTED
QStack< XmlRef > xmlRefStack
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual bool attributeDecl(const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)=0
The reader calls this function to report an attribute type declaration.
virtual QString errorString() const =0
The reader calls this function to get an error string if any of the handler functions returns false...
bool isOpen() const
Returns true if the device is open; otherwise returns false.
QXmlLocator()
Constructor.
static bool isEmpty(const char *str)
bool endDTD()
This reimplementation does nothing.
bool startCDATA()
This reimplementation does nothing.
#define XMLERR_ERRORPARSINGREFERENCE
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
QXmlParseExceptionPrivate()
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
void setContentHandler(QXmlContentHandler *handler)
Reimplemented Function
virtual bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName)=0
The reader calls this function when it finds an unparsed entity declaration.
int size() const
Returns the number of characters in this string.
const QChar * unicode() const
Returns a '\0'-terminated Unicode representation of the string.
bool entityExist(const QString &) const
static bool is_S(QChar ch)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
#define XMLERR_ERRORPARSINGCOMMENT
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
#define XMLERR_ERRORPARSINGCONTENT
void reportParseError(const QString &error)
const T value(const Key &key) const
Returns the value associated with the key key.
int lineNumber() const
Returns the line number (starting at 1) or -1 if there is no line number available.
The QStringList class provides a list of strings.
XmlRef(const QString &_name, const QString &_value)
QXmlSimpleReaderLocator(QXmlSimpleReader *parent)
#define XMLERR_INVALIDNAMEFORPI
Q_CORE_EXPORT void qWarning(const char *,...)
#define XMLERR_ERRORINTEXTDECL
virtual int mibEnum() const =0
Subclasses of QTextCodec must reimplement this function.
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QMap< QString, ExternParameterEntity > externParameterEntities
static QTextCodec * codec(MYSQL *mysql)
virtual bool comment(const QString &ch)=0
The reader calls this function to report an XML comment anywhere in the document. ...
QXmlContentHandler * contentHandler() const
Reimplemented Function
int columnNumber() const
Returns the column number where the error occurred.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static QTextCodec * codecForMib(int mib)
Returns the QTextCodec which matches the MIBenum mib.
bool parseReference_charDataRead
The QXmlContentHandler class provides an interface to report the logical content of XML data...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
#define XMLERR_RECURSIVEENTITIES
bool useNamespacePrefixes
QXmlDeclHandler * declHnd
bool internalEntityDecl(const QString &name, const QString &value)
This reimplementation does nothing.
bool startPrefixMapping(const QString &prefix, const QString &uri)
This reimplementation does nothing.
void setEntityResolver(QXmlEntityResolver *handler)
Reimplemented Function
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
virtual bool startEntity(const QString &name)=0
The reader calls this function to report the start of an entity called name.
bool processingInstruction(const QString &target, const QString &data)
This reimplementation does nothing.
~QXmlNamespaceSupport()
Destroys a QXmlNamespaceSupport.
QXmlNamespaceSupportPrivate()
void push(const T &t)
Adds element t to the top of the stack.
#define XMLERR_EXTERNALGENERALENTITYINDTD
static const signed char cltPer
virtual bool notationDecl(const QString &name, const QString &publicId, const QString &systemId)=0
The reader calls this function when it has parsed a notation declaration.
virtual bool processingInstruction(const QString &target, const QString &data)=0
The reader calls this function when it has parsed a processing instruction.
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
static void updateValue(QString &value, const QChar *array, int &arrayPos, int &valueLen)
bool startDTD(const QString &name, const QString &publicId, const QString &systemId)
This reimplementation does nothing.
QXmlEntityResolver * entityRes
bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId)
This reimplementation does nothing.
QHash< QString, int > expandedSizes
void setDTDHandler(QXmlDTDHandler *handler)
Reimplemented Function
virtual bool endDocument()=0
The reader calls this function after it has finished parsing.
bool comment(const QString &ch)
This reimplementation does nothing.
void resize(int size)
Sets the size of the string to size characters.
virtual bool startCDATA()=0
The reader calls this function to report the start of a CDATA section.
~QXmlSimpleReaderPrivate()
const char * constData() const
Returns a pointer to the data stored in the byte array.
QXmlNamespaceSupport namespaceSupport
bool isNull() const
Returns true if this string is null; otherwise returns false.
QHash< QString, int > literalEntitySizes
QString message() const
Returns the error message.
static const signed char cltDash
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
virtual bool endEntity(const QString &name)=0
The reader calls this function to report the end of an entity called name.
virtual bool endPrefixMapping(const QString &prefix)=0
The reader calls this function to signal the end of a prefix mapping for the prefix prefix...
ExternParameterEntity(const QString &p, const QString &s)
bool isExpandedEntityValueTooLarge(QString *errorMessage)
#define Q_DECLARE_PUBLIC(Class)
QXmlErrorHandler * errorHnd
~QXmlParseException()
Destroys the QXmlParseException.
QString & append(QChar c)
QMap< QString, QString > parameterEntities
void initIncrementalParsing()
bool endEntity(const QString &name)
This reimplementation does nothing.
void * fetchData(QTestData *data, const char *tagName, int typeId)
The QFile class provides an interface for reading from and writing to files.
static const signed char cltGt
int length() const
Returns the number of attributes in the list.
#define XMLERR_EXTERNALGENERALENTITYINAV
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
QString uri(int index) const
Looks up an attribute's namespace URI for the attribute at position index.
The QTextStream class provides a convenient interface for reading and writing text.
void clear()
Clears the contents of the string and makes it empty.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
static const signed char cltDq
QString systemId() const
Returns the system identifier where the error occurred.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
virtual QString errorString() const =0
The reader calls this function to get an error string, e.
QMap< QString, QString > NamespaceMap
EntityRecognitionContext parseReference_context
void resize(int size)
Sets the size of the byte array to size bytes.
QXmlEntityResolver * entityResolver() const
Reimplemented Function
QString errorString() const
Returns the default error string.
bool warning(const QXmlParseException &exception)
This reimplementation does nothing.
QStack< NamespaceMap > nsStack
virtual bool characters(const QString &ch)=0
The reader calls this function when it has parsed a chunk of character data (either normal character ...
virtual bool endCDATA()=0
The reader calls this function to report the end of a CDATA section.
virtual ~QXmlLocator()
Destructor.
uint toUInt(bool *ok=0, int base=10) const
Returns the string converted to an unsigned int using base base, which is 10 by default and must be b...
uchar cell() const
Returns the cell (least significant byte) of the Unicode character.
EntityRecognitionContext parsePEReference_context
QString qName(int index) const
Looks up an attribute's XML 1.0 qualified name for the attribute at position index.
void splitName(const QString &, QString &, QString &) const
Splits the name qname at the ':' and returns the prefix in prefix and the local name in localname...
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
bool fatalError(const QXmlParseException &exception)
This reimplementation does nothing.
bool resolveEntity(const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
Sets ret to 0, so that the reader uses the system identifier provided in the XML document.
static const signed char cltEq
int size() const
Returns the number of bytes in this byte array.
virtual bool open(OpenMode mode)
Opens the device and sets its OpenMode to mode.
virtual bool endDTD()=0
The reader calls this function to report the end of a DTD declaration, if any.
void init(const QXmlInputSource *i)
~QXmlNamespaceSupportPrivate()
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
This reimplementation does nothing.
QString prefix(const QString &) const
Returns one of the prefixes mapped to the namespace URI uri.
The QXmlAttributes class provides XML attributes.
QString publicId() const
Returns the public identifier where the error occurred.
bool error(const QXmlParseException &exception)
This reimplementation does nothing.
QScopedPointer< QXmlLocator > locator
QXmlDTDHandler * DTDHandler() const
Reimplemented Function
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QXmlEntityResolver class provides an interface to resolve external entities contained in XML data...
QHash< QString, QHash< QString, int > > referencesToOtherEntities
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
This reimplementation does nothing.
The QXmlDeclHandler class provides an interface to report declaration content of XML data...
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
virtual bool resolveEntity(const QString &publicId, const QString &systemId, QXmlInputSource *&ret)=0
The reader calls this function before it opens any external entity, except the top-level document ent...
static const signed char charLookupTable[256]
void setPrefix(const QString &, const QString &)
This function declares a prefix pre in the current namespace context to be the namespace URI uri...
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
static const signed char cltCB
void append(const QString &qName, const QString &uri, const QString &localPart, const QString &value)
Appends a new attribute entry to the list of attributes.
The QTextCodec class provides conversions between text encodings.
#define XMLERR_UNEXPECTEDEOF
char at(int i) const
Returns the character at index position i in the byte array.
QImageIOHandler * handler
QXmlInputSource * inputSource
virtual QString errorString() const =0
The reader calls this function to get an error string if any of the handler functions returns false...
The QIODevice class is the base interface class of all I/O devices in Qt.
#define XMLERR_WRONGVALUEFORSDECL
void setFeature(const QString &name, bool value)
Turns on the feature name if enable is true; otherwise turns it off.
bool startDocument()
This reimplementation does nothing.
bool endDocument()
This reimplementation does nothing.
bool feature(const QString &name, bool *ok=0) const
Reimplemented Function
QXmlDeclHandler * declHandler() const
Reimplemented Function
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
uchar row() const
Returns the row (most significant byte) of the Unicode character.
static NameChar fastDetermineNameChar(QChar ch)
QString uri(const QString &) const
Looks up the prefix prefix in the current context and returns the currently-mapped namespace URI...
bool ignorableWhitespace(const QString &ch)
This reimplementation does nothing.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
virtual bool internalEntityDecl(const QString &name, const QString &value)=0
The reader calls this function to report an internal entity declaration.
virtual bool startPrefixMapping(const QString &prefix, const QString &uri)=0
The reader calls this function to signal the begin of a prefix-URI namespace mapping scope...
QMap< QString, ExternEntity > externEntities
const QChar * constData() const
Returns a pointer to the data stored in the QString.
QScopedPointer< QXmlParseExceptionPrivate > d
QXmlContentHandler * contentHnd
void clear()
Removes all items from the map.
The QMap class is a template class that provides a skip-list-based dictionary.
void setDocumentLocator(QXmlLocator *locator)
This reimplementation does nothing.
The QXmlParseException class is used to report errors with the QXmlErrorHandler interface.
virtual bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId)=0
The reader calls this function to report a parsed external entity declaration.
T & top()
Returns a reference to the stack's top item.
#define XMLERR_EDECLORSDDECLEXPECTED
int lineNumber() const
Returns the line number where the error occurred.
QXmlNamespaceSupportPrivate * d
void clear()
Clears the list of attributes.
bool processElementETagBegin2()
bool attributeDecl(const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
This reimplementation does nothing.
friend class const_iterator
QXmlErrorHandler * errorHandler() const
Reimplemented Function
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)=0
The reader calls this function when it has parsed an end element tag with the qualified name qName...
void pushContext()
Starts a new namespace context.
virtual bool fatalError(const QXmlParseException &exception)=0
A reader must use this function to report a non-recoverable error.
#define XMLERR_ERRORBYCONSUMER