⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 saxparsertest.cpp

📁 C++ class libraries for network-centric, portable applications, integrated perfectly with the C++ St
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SAXParserTest");	CppUnit_addTest(pSuite, SAXParserTest, testSimple1);	CppUnit_addTest(pSuite, SAXParserTest, testSimple2);	CppUnit_addTest(pSuite, SAXParserTest, testAttributes);	CppUnit_addTest(pSuite, SAXParserTest, testCDATA);	CppUnit_addTest(pSuite, SAXParserTest, testComment);	CppUnit_addTest(pSuite, SAXParserTest, testPI);	CppUnit_addTest(pSuite, SAXParserTest, testDTD);	CppUnit_addTest(pSuite, SAXParserTest, testInternalEntity);	CppUnit_addTest(pSuite, SAXParserTest, testNotation);	CppUnit_addTest(pSuite, SAXParserTest, testExternalUnparsed);	CppUnit_addTest(pSuite, SAXParserTest, testExternalParsed);	CppUnit_addTest(pSuite, SAXParserTest, testDefaultNamespace);	CppUnit_addTest(pSuite, SAXParserTest, testNamespaces);	CppUnit_addTest(pSuite, SAXParserTest, testNamespacesNoPrefixes);	CppUnit_addTest(pSuite, SAXParserTest, testNoNamespaces);	CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNamespace);	CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNamespaceNoPrefixes);	CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNoNamespace);	CppUnit_addTest(pSuite, SAXParserTest, testRSS);	CppUnit_addTest(pSuite, SAXParserTest, testEncoding);	return pSuite;}const std::string SAXParserTest::SIMPLE1 =	"<foo/>\n";const std::string SAXParserTest::SIMPLE2 =	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"	"<foo/>\n";const std::string SAXParserTest::ATTRIBUTES =	"<root a1=\"v1\">\n"	"\t<elem a1=\"v1\" a2=\"v2\"/>\n"	"</root>";const std::string SAXParserTest::CDATA = 	"<data>\n"	"<![CDATA[\n"	"\tThe following <tag attr=\"value\">is inside a CDATA section</tag>.\n"	"]]>\n"	"</data>";const std::string SAXParserTest::COMMENT =	"<!--this is a comment-->"	"<root>\n"	"\t<!--another comment-->\n"	"\t<elem/>\n"	"</root>";const std::string SAXParserTest::PROCESSING_INSTRUCTION =	"<html>\n"	"\t<head>\n"	"\t\t<?xml-stylesheet href=\"style.css\" type=\"text/css\"?>\n"	"\t\t<title>test</title>\n"	"\t</head>\n"	"\t<body>\n"	"\t\t<p>this is a test</p>\n"	"\t</body>\n"	"</html>";const std::string SAXParserTest::DTD = 	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"	"<!DOCTYPE test SYSTEM \"test.dtd\">\n"	"<foo/>";	const std::string SAXParserTest::INTERNAL_ENTITY =    "<!DOCTYPE sample [\n"    "\t<!ENTITY appinf \"Applied Informatics\">\n"    "]>\n"    "<root>\n"    "\t<company>&appinf;</company>\n"    "</root>";const std::string SAXParserTest::NOTATION =	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"	"<!DOCTYPE test [\n"	"\t<!NOTATION mov SYSTEM \"quicktime\">\n"	"\t<!NOTATION xml PUBLIC \"-//W3C//NOTATION XML 1.0//EN\">\n"	"]>\n"	"<foo/>";const std::string SAXParserTest::EXTERNAL_UNPARSED =	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"	"<!DOCTYPE test [\n"	"\t<!NOTATION mov SYSTEM \"quicktime\">\n"	"\t<!ENTITY movie SYSTEM \"movie.mov\" NDATA mov>\n"	"]>\n"	"<sample/>";const std::string SAXParserTest::EXTERNAL_PARSED = 	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"	"<!DOCTYPE test [\n"	"\t<!ENTITY include SYSTEM \"include.xml\">\n"	"]>\n"	"<sample>\n"	"\t&include;\n"	"</sample>\n";const std::string SAXParserTest::INCLUDE = 	"<elem>\n"	"\tAn external entity.\n"	"</elem>\n";const std::string SAXParserTest::DEFAULT_NAMESPACE =	"<root xmlns=\"urn:ns1\">\n"	"\t<elem>data</elem>\n"	"</root>";const std::string SAXParserTest::NAMESPACES =	"<ns1:root xmlns:ns1=\"urn:ns1\" xmlns:ns2=\"urn:ns2\">\n"	"\t<ns2:elem>data</ns2:elem>\n"	"\t<ns3:elem a1=\"v1\" ns2:a2=\"v2\" xmlns:ns3=\"urn:ns3\">\n"	"\t\tmore data\n"	"\t</ns3:elem>\n"	"</ns1:root>";const std::string SAXParserTest::UNDECLARED_NAMESPACE =	"<ns1:root xmlns:ns1=\"urn:ns1\" xmlns:ns2=\"urn:ns2\">\n"	"\t<ns2:elem>data</ns2:elem>\n"	"\t<ns3:elem a1=\"v1\" ns2:a2=\"v2\" xmlns:ns3=\"urn:ns3\">\n"	"\t\tmore data\n"	"\t</ns3:elem>\n"	"\t<ns4:elem/>\n"	"</ns1:root>";const std::string SAXParserTest::XHTML_LATIN1_ENTITIES =	"<!-- Portions (C) International Organization for Standardization 1986\n"	"     Permission to copy in any form is granted for use with\n"	"     conforming SGML systems and applications as defined in\n"	"     ISO 8879, provided this notice is included in all copies.\n"	"-->\n"	"<!-- Character entity set. Typical invocation:\n"	"    <!ENTITY % HTMLlat1 PUBLIC\n"	"       \"-//W3C//ENTITIES Latin 1 for XHTML//EN\"\n"	"       \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"	"    %HTMLlat1;\n"	"-->\n"	"\n"	"<!ENTITY nbsp   \"&#160;\"> <!-- no-break space = non-breaking space,\n"	"                                  U+00A0 ISOnum -->\n"	"<!ENTITY iexcl  \"&#161;\"> <!-- inverted exclamation mark, U+00A1 ISOnum -->\n"	"<!ENTITY cent   \"&#162;\"> <!-- cent sign, U+00A2 ISOnum -->\n"	"<!ENTITY pound  \"&#163;\"> <!-- pound sign, U+00A3 ISOnum -->\n"	"<!ENTITY curren \"&#164;\"> <!-- currency sign, U+00A4 ISOnum -->\n"	"<!ENTITY yen    \"&#165;\"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->\n"	"<!ENTITY brvbar \"&#166;\"> <!-- broken bar = broken vertical bar,\n"	"                                  U+00A6 ISOnum -->\n"	"<!ENTITY sect   \"&#167;\"> <!-- section sign, U+00A7 ISOnum -->\n"	"<!ENTITY uml    \"&#168;\"> <!-- diaeresis = spacing diaeresis,\n"	"                                  U+00A8 ISOdia -->\n"	"<!ENTITY copy   \"&#169;\"> <!-- copyright sign, U+00A9 ISOnum -->\n"	"<!ENTITY ordf   \"&#170;\"> <!-- feminine ordinal indicator, U+00AA ISOnum -->\n"	"<!ENTITY laquo  \"&#171;\"> <!-- left-pointing double angle quotation mark\n"	"                                  = left pointing guillemet, U+00AB ISOnum -->\n"	"<!ENTITY not    \"&#172;\"> <!-- not sign = angled dash,\n"	"                                  U+00AC ISOnum -->\n"	"<!ENTITY shy    \"&#173;\"> <!-- soft hyphen = discretionary hyphen,\n"	"                                  U+00AD ISOnum -->\n"	"<!ENTITY reg    \"&#174;\"> <!-- registered sign = registered trade mark sign,\n"	"                                  U+00AE ISOnum -->\n"	"<!ENTITY macr   \"&#175;\"> <!-- macron = spacing macron = overline\n"	"                                  = APL overbar, U+00AF ISOdia -->\n"	"<!ENTITY deg    \"&#176;\"> <!-- degree sign, U+00B0 ISOnum -->\n"	"<!ENTITY plusmn \"&#177;\"> <!-- plus-minus sign = plus-or-minus sign,\n"	"                                  U+00B1 ISOnum -->\n"	"<!ENTITY sup2   \"&#178;\"> <!-- superscript two = superscript digit two\n"	"                                  = squared, U+00B2 ISOnum -->\n"	"<!ENTITY sup3   \"&#179;\"> <!-- superscript three = superscript digit three\n"	"                                  = cubed, U+00B3 ISOnum -->\n"	"<!ENTITY acute  \"&#180;\"> <!-- acute accent = spacing acute,\n"	"                                  U+00B4 ISOdia -->\n"	"<!ENTITY micro  \"&#181;\"> <!-- micro sign, U+00B5 ISOnum -->\n"	"<!ENTITY para   \"&#182;\"> <!-- pilcrow sign = paragraph sign,\n"	"                                  U+00B6 ISOnum -->\n"	"<!ENTITY middot \"&#183;\"> <!-- middle dot = Georgian comma\n"	"                                  = Greek middle dot, U+00B7 ISOnum -->\n"	"<!ENTITY cedil  \"&#184;\"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->\n"	"<!ENTITY sup1   \"&#185;\"> <!-- superscript one = superscript digit one,\n"	"                                  U+00B9 ISOnum -->\n"	"<!ENTITY ordm   \"&#186;\"> <!-- masculine ordinal indicator,\n"	"                                  U+00BA ISOnum -->\n"	"<!ENTITY raquo  \"&#187;\"> <!-- right-pointing double angle quotation mark\n"	"                                  = right pointing guillemet, U+00BB ISOnum -->\n"	"<!ENTITY frac14 \"&#188;\"> <!-- vulgar fraction one quarter\n"	"                                  = fraction one quarter, U+00BC ISOnum -->\n"	"<!ENTITY frac12 \"&#189;\"> <!-- vulgar fraction one half\n"	"                                  = fraction one half, U+00BD ISOnum -->\n"	"<!ENTITY frac34 \"&#190;\"> <!-- vulgar fraction three quarters\n"	"                                  = fraction three quarters, U+00BE ISOnum -->\n"	"<!ENTITY iquest \"&#191;\"> <!-- inverted question mark\n"	"                                  = turned question mark, U+00BF ISOnum -->\n"	"<!ENTITY Agrave \"&#192;\"> <!-- latin capital letter A with grave\n"	"                                  = latin capital letter A grave,\n"	"                                  U+00C0 ISOlat1 -->\n"	"<!ENTITY Aacute \"&#193;\"> <!-- latin capital letter A with acute,\n"	"                                  U+00C1 ISOlat1 -->\n"	"<!ENTITY Acirc  \"&#194;\"> <!-- latin capital letter A with circumflex,\n"	"                                  U+00C2 ISOlat1 -->\n"	"<!ENTITY Atilde \"&#195;\"> <!-- latin capital letter A with tilde,\n"	"                                  U+00C3 ISOlat1 -->\n"	"<!ENTITY Auml   \"&#196;\"> <!-- latin capital letter A with diaeresis,\n"	"                                  U+00C4 ISOlat1 -->\n"	"<!ENTITY Aring  \"&#197;\"> <!-- latin capital letter A with ring above\n"	"                                  = latin capital letter A ring,\n"	"                                  U+00C5 ISOlat1 -->\n"	"<!ENTITY AElig  \"&#198;\"> <!-- latin capital letter AE\n"	"                                  = latin capital ligature AE,\n"	"                                  U+00C6 ISOlat1 -->\n"	"<!ENTITY Ccedil \"&#199;\"> <!-- latin capital letter C with cedilla,\n"	"                                  U+00C7 ISOlat1 -->\n"	"<!ENTITY Egrave \"&#200;\"> <!-- latin capital letter E with grave,\n"	"                                  U+00C8 ISOlat1 -->\n"	"<!ENTITY Eacute \"&#201;\"> <!-- latin capital letter E with acute,\n"	"                                  U+00C9 ISOlat1 -->\n"	"<!ENTITY Ecirc  \"&#202;\"> <!-- latin capital letter E with circumflex,\n"	"                                  U+00CA ISOlat1 -->\n"	"<!ENTITY Euml   \"&#203;\"> <!-- latin capital letter E with diaeresis,\n"	"                                  U+00CB ISOlat1 -->\n"	"<!ENTITY Igrave \"&#204;\"> <!-- latin capital letter I with grave,\n"	"                                  U+00CC ISOlat1 -->\n"	"<!ENTITY Iacute \"&#205;\"> <!-- latin capital letter I with acute,\n"	"                                  U+00CD ISOlat1 -->\n"	"<!ENTITY Icirc  \"&#206;\"> <!-- latin capital letter I with circumflex,\n"	"                                  U+00CE ISOlat1 -->\n"	"<!ENTITY Iuml   \"&#207;\"> <!-- latin capital letter I with diaeresis,\n"	"                                  U+00CF ISOlat1 -->\n"	"<!ENTITY ETH    \"&#208;\"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->\n"	"<!ENTITY Ntilde \"&#209;\"> <!-- latin capital letter N with tilde,\n"	"                                  U+00D1 ISOlat1 -->\n"	"<!ENTITY Ograve \"&#210;\"> <!-- latin capital letter O with grave,\n"	"                                  U+00D2 ISOlat1 -->\n"	"<!ENTITY Oacute \"&#211;\"> <!-- latin capital letter O with acute,\n"	"                                  U+00D3 ISOlat1 -->\n"	"<!ENTITY Ocirc  \"&#212;\"> <!-- latin capital letter O with circumflex,\n"	"                                  U+00D4 ISOlat1 -->\n"	"<!ENTITY Otilde \"&#213;\"> <!-- latin capital letter O with tilde,\n"	"                                  U+00D5 ISOlat1 -->\n"	"<!ENTITY Ouml   \"&#214;\"> <!-- latin capital letter O with diaeresis,\n"	"                                  U+00D6 ISOlat1 -->\n"	"<!ENTITY times  \"&#215;\"> <!-- multiplication sign, U+00D7 ISOnum -->\n"	"<!ENTITY Oslash \"&#216;\"> <!-- latin capital letter O with stroke\n"	"                                  = latin capital letter O slash,\n"	"                                  U+00D8 ISOlat1 -->\n"	"<!ENTITY Ugrave \"&#217;\"> <!-- latin capital letter U with grave,\n"	"                                  U+00D9 ISOlat1 -->\n"	"<!ENTITY Uacute \"&#218;\"> <!-- latin capital letter U with acute,\n"	"                                  U+00DA ISOlat1 -->\n"	"<!ENTITY Ucirc  \"&#219;\"> <!-- latin capital letter U with circumflex,\n"	"                                  U+00DB ISOlat1 -->\n"	"<!ENTITY Uuml   \"&#220;\"> <!-- latin capital letter U with diaeresis,\n"	"                                  U+00DC ISOlat1 -->\n"	"<!ENTITY Yacute \"&#221;\"> <!-- latin capital letter Y with acute,\n"	"                                  U+00DD ISOlat1 -->\n"	"<!ENTITY THORN  \"&#222;\"> <!-- latin capital letter THORN,\n"	"                                  U+00DE ISOlat1 -->\n"	"<!ENTITY szlig  \"&#223;\"> <!-- latin small letter sharp s = ess-zed,\n"	"                                  U+00DF ISOlat1 -->\n"	"<!ENTITY agrave \"&#224;\"> <!-- latin small letter a with grave\n"	"                                  = latin small letter a grave,\n"	"                                  U+00E0 ISOlat1 -->\n"	"<!ENTITY aacute \"&#225;\"> <!-- latin small letter a with acute,\n"	"                                  U+00E1 ISOlat1 -->\n"	"<!ENTITY acirc  \"&#226;\"> <!-- latin small letter a with circumflex,\n"	"                                  U+00E2 ISOlat1 -->\n"	"<!ENTITY atilde \"&#227;\"> <!-- latin small letter a with tilde,\n"	"                                  U+00E3 ISOlat1 -->\n"	"<!ENTITY auml   \"&#228;\"> <!-- latin small letter a with diaeresis,\n"	"                                  U+00E4 ISOlat1 -->\n"	"<!ENTITY aring  \"&#229;\"> <!-- latin small letter a with ring above\n"	"                                  = latin small letter a ring,\n"	"                                  U+00E5 ISOlat1 -->\n"	"<!ENTITY aelig  \"&#230;\"> <!-- latin small letter ae\n"	"                                  = latin small ligature ae, U+00E6 ISOlat1 -->\n"	"<!ENTITY ccedil \"&#231;\"> <!-- latin small letter c with cedilla,\n"	"                                  U+00E7 ISOlat1 -->\n"	"<!ENTITY egrave \"&#232;\"> <!-- latin small letter e with grave,\n"	"                                  U+00E8 ISOlat1 -->\n"	"<!ENTITY eacute \"&#233;\"> <!-- latin small letter e with acute,\n"	"                                  U+00E9 ISOlat1 -->\n"	"<!ENTITY ecirc  \"&#234;\"> <!-- latin small letter e with circumflex,\n"	"                                  U+00EA ISOlat1 -->\n"	"<!ENTITY euml   \"&#235;\"> <!-- latin small letter e with diaeresis,\n"	"                                  U+00EB ISOlat1 -->\n"	"<!ENTITY igrave \"&#236;\"> <!-- latin small letter i with grave,\n"	"                                  U+00EC ISOlat1 -->\n"	"<!ENTITY iacute \"&#237;\"> <!-- latin small letter i with acute,\n"	"                                  U+00ED ISOlat1 -->\n"	"<!ENTITY icirc  \"&#238;\"> <!-- latin small letter i with circumflex,\n"	"                                  U+00EE ISOlat1 -->\n"	"<!ENTITY iuml   \"&#239;\"> <!-- latin small letter i with diaeresis,\n"	"                                  U+00EF ISOlat1 -->\n"	"<!ENTITY eth    \"&#240;\"> <!-- latin small letter eth, U+00F0 ISOlat1 -->\n"	"<!ENTITY ntilde \"&#241;\"> <!-- latin small letter n with tilde,\n"	"                                  U+00F1 ISOlat1 -->\n"	"<!ENTITY ograve \"&#242;\"> <!-- latin small letter o with grave,\n"	"                                  U+00F2 ISOlat1 -->\n"	"<!ENTITY oacute \"&#243;\"> <!-- latin small letter o with acute,\n"	"                                  U+00F3 ISOlat1 -->\n"	"<!ENTITY ocirc  \"&#244;\"> <!-- latin small letter o with circumflex,\n"	"                                  U+00F4 ISOlat1 -->\n"	"<!ENTITY otilde \"&#245;\"> <!-- latin small letter o with tilde,\n"	"                                  U+00F5 ISOlat1 -->\n"	"<!ENTITY ouml   \"&#246;\"> <!-- latin small letter o with diaeresis,\n"	"                                  U+00F6 ISOlat1 -->\n"	"<!ENTITY divide \"&#247;\"> <!-- division sign, U+00F7 ISOnum -->\n"	"<!ENTITY oslash \"&#248;\"> <!-- latin small letter o with stroke,\n"	"                                  = latin small letter o slash,\n"	"                                  U+00F8 ISOlat1 -->\n"	"<!ENTITY ugrave \"&#249;\"> <!-- latin small letter u with grave,\n"	"                                  U+00F9 ISOlat1 -->\n"	"<!ENTITY uacute \"&#250;\"> <!-- latin small letter u with acute,\n"	"                                  U+00FA ISOlat1 -->\n"	"<!ENTITY ucirc  \"&#251;\"> <!-- latin small letter u with circumflex,\n"	"                                  U+00FB ISOlat1 -->\n"	"<!ENTITY uuml   \"&#252;\"> <!-- latin small letter u with diaeresis,\n"	"                                  U+00FC ISOlat1 -->\n"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -