XmlReaderCommonTests.cs 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376
  1. //
  2. // System.Xml.XmlReaderCommonTests
  3. //
  4. // Authors:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // (C) 2003 Atsushi Enomoto
  8. // Note: Most of testcases are moved from XmlTextReaderTests.cs and
  9. // XmlNodeReaderTests.cs.
  10. //
  11. using System;
  12. using System.IO;
  13. using System.Text;
  14. using System.Xml;
  15. using System.Xml.XPath;
  16. using NUnit.Framework;
  17. namespace MonoTests.System.Xml
  18. {
  19. [TestFixture]
  20. public class XmlReaderTests : Assertion
  21. {
  22. [SetUp]
  23. public void GetReady ()
  24. {
  25. document = new XmlDocument ();
  26. document.LoadXml (xml1);
  27. }
  28. XmlDocument document;
  29. const string xml1 = "<root attr1='value1'><child /></root>";
  30. const string xml2 = "<root><foo/><bar>test.</bar></root>";
  31. const string xml3 = "<root> test of <b>mixed</b> string.<![CDATA[ cdata string.]]></root>";
  32. const string xml4 = "<root>test of <b>mixed</b> string.</root>";
  33. XmlTextReader xtr;
  34. XmlNodeReader xnr;
  35. // copy from XmlTextReaderTests
  36. private void AssertStartDocument (XmlReader xmlReader)
  37. {
  38. Assert (xmlReader.ReadState == ReadState.Initial);
  39. Assert (xmlReader.NodeType == XmlNodeType.None);
  40. Assert (xmlReader.Depth == 0);
  41. Assert (!xmlReader.EOF);
  42. }
  43. private void AssertNode (
  44. XmlReader xmlReader,
  45. XmlNodeType nodeType,
  46. int depth,
  47. bool isEmptyElement,
  48. string name,
  49. string prefix,
  50. string localName,
  51. string namespaceURI,
  52. string value,
  53. int attributeCount)
  54. {
  55. Assert ("Read() return value", xmlReader.Read ());
  56. Assert ("ReadState", xmlReader.ReadState == ReadState.Interactive);
  57. Assert ("!EOF", !xmlReader.EOF);
  58. AssertNodeValues (xmlReader, nodeType, depth, isEmptyElement, name, prefix, localName, namespaceURI, value, attributeCount);
  59. }
  60. private void AssertNodeValues (
  61. XmlReader xmlReader,
  62. XmlNodeType nodeType,
  63. int depth,
  64. bool isEmptyElement,
  65. string name,
  66. string prefix,
  67. string localName,
  68. string namespaceURI,
  69. string value,
  70. int attributeCount)
  71. {
  72. AssertNodeValues (xmlReader, nodeType, depth, isEmptyElement, name, prefix, localName, namespaceURI, value, value != String.Empty, attributeCount, attributeCount > 0);
  73. }
  74. private void AssertNodeValues (
  75. XmlReader xmlReader,
  76. XmlNodeType nodeType,
  77. int depth,
  78. bool isEmptyElement,
  79. string name,
  80. string prefix,
  81. string localName,
  82. string namespaceURI,
  83. string value,
  84. bool hasValue,
  85. int attributeCount,
  86. bool hasAttributes)
  87. {
  88. AssertEquals ("NodeType", nodeType, xmlReader.NodeType);
  89. AssertEquals ("IsEmptyElement", isEmptyElement, xmlReader.IsEmptyElement);
  90. AssertEquals ("name", name, xmlReader.Name);
  91. AssertEquals ("prefix", prefix, xmlReader.Prefix);
  92. AssertEquals ("localName", localName, xmlReader.LocalName);
  93. AssertEquals ("namespaceURI", namespaceURI, xmlReader.NamespaceURI);
  94. AssertEquals ("Depth", depth, xmlReader.Depth);
  95. AssertEquals ("hasValue", hasValue, xmlReader.HasValue);
  96. AssertEquals ("Value", value, xmlReader.Value);
  97. AssertEquals ("hasAttributes", hasAttributes, xmlReader.HasAttributes);
  98. AssertEquals ("attributeCount", attributeCount, xmlReader.AttributeCount);
  99. }
  100. private void AssertAttribute (
  101. XmlReader xmlReader,
  102. string name,
  103. string prefix,
  104. string localName,
  105. string namespaceURI,
  106. string value)
  107. {
  108. AssertEquals ("value", value, xmlReader [name]);
  109. Assert (xmlReader.GetAttribute (name) == value);
  110. if (namespaceURI != String.Empty) {
  111. Assert (xmlReader[localName, namespaceURI] == value);
  112. Assert (xmlReader.GetAttribute (localName, namespaceURI) == value);
  113. }
  114. }
  115. private void AssertEndDocument (XmlReader xmlReader)
  116. {
  117. Assert ("could read", !xmlReader.Read ());
  118. AssertEquals ("NodeType is not XmlNodeType.None", XmlNodeType.None, xmlReader.NodeType);
  119. AssertEquals ("Depth is not 0", 0, xmlReader.Depth);
  120. AssertEquals ("ReadState is not ReadState.EndOfFile", ReadState.EndOfFile, xmlReader.ReadState);
  121. Assert ("not EOF", xmlReader.EOF);
  122. xmlReader.Close ();
  123. AssertEquals ("ReadState is not ReadState.Cosed", ReadState.Closed, xmlReader.ReadState);
  124. }
  125. private delegate void TestMethod (XmlReader reader);
  126. private void RunTest (string xml, TestMethod method)
  127. {
  128. xtr = new XmlTextReader (new StringReader (xml));
  129. method (xtr);
  130. // DTD validation
  131. xtr = new XmlTextReader (new StringReader (xml));
  132. XmlValidatingReader xvr = new XmlValidatingReader (xtr);
  133. xvr.ValidationType = ValidationType.DTD;
  134. xvr.EntityHandling = EntityHandling.ExpandCharEntities;
  135. method (xvr);
  136. // XSD validation
  137. xtr = new XmlTextReader (new StringReader (xml));
  138. xvr = new XmlValidatingReader (xtr);
  139. xvr.EntityHandling = EntityHandling.ExpandCharEntities;
  140. method (xvr);
  141. document.XmlResolver = null;
  142. document.LoadXml (xml);
  143. xnr = new XmlNodeReader (document);
  144. method (xnr);
  145. }
  146. [Test]
  147. public void InitialState ()
  148. {
  149. RunTest (xml1, new TestMethod (InitialState));
  150. }
  151. private void InitialState (XmlReader reader)
  152. {
  153. AssertEquals ("Depth", 0, reader.Depth);
  154. AssertEquals ("EOF", false, reader.EOF);
  155. AssertEquals ("HasValue", false, reader.HasValue);
  156. AssertEquals ("IsEmptyElement", false, reader.IsEmptyElement);
  157. AssertEquals ("LocalName", String.Empty, reader.LocalName);
  158. AssertEquals ("NodeType", XmlNodeType.None, reader.NodeType);
  159. AssertEquals ("ReadState", ReadState.Initial, reader.ReadState);
  160. }
  161. [Test]
  162. public void Read ()
  163. {
  164. RunTest (xml1, new TestMethod (Read));
  165. }
  166. public void Read (XmlReader reader)
  167. {
  168. reader.Read ();
  169. AssertEquals ("<root>.NodeType", XmlNodeType.Element, reader.NodeType);
  170. AssertEquals ("<root>.Name", "root", reader.Name);
  171. AssertEquals ("<root>.ReadState", ReadState.Interactive, reader.ReadState);
  172. AssertEquals ("<root>.Depth", 0, reader.Depth);
  173. // move to 'child'
  174. reader.Read ();
  175. AssertEquals ("<child/>.Depth", 1, reader.Depth);
  176. AssertEquals ("<child/>.NodeType", XmlNodeType.Element, reader.NodeType);
  177. AssertEquals ("<child/>.Name", "child", reader.Name);
  178. reader.Read ();
  179. AssertEquals ("</root>.Depth", 0, reader.Depth);
  180. AssertEquals ("</root>.NodeType", XmlNodeType.EndElement, reader.NodeType);
  181. AssertEquals ("</root>.Name", "root", reader.Name);
  182. reader.Read ();
  183. AssertEquals ("end.EOF", true, reader.EOF);
  184. AssertEquals ("end.NodeType", XmlNodeType.None, reader.NodeType);
  185. }
  186. [Test]
  187. public void ReadAttributeValue ()
  188. {
  189. RunTest ("<root attr=''/>", new TestMethod (ReadAttributeValue));
  190. }
  191. public void ReadAttributeValue (XmlReader reader)
  192. {
  193. reader.Read (); // root
  194. Assert (reader.MoveToFirstAttribute ());
  195. // It looks like that MS.NET shows AttributeCount and
  196. // HasAttributes as the same as element node!
  197. this.AssertNodeValues (reader, XmlNodeType.Attribute,
  198. 1, false, "attr", "", "attr", "", "", true, 1, true);
  199. Assert (reader.ReadAttributeValue ());
  200. // MS.NET XmlTextReader fails. Its Prefix returns null instead of "".
  201. this.AssertNodeValues (reader, XmlNodeType.Text,
  202. 2, false, "", "", "", "", "", true, 1, true);
  203. Assert (reader.MoveToElement ());
  204. this.AssertNodeValues (reader, XmlNodeType.Element,
  205. 0, true, "root", "", "root", "", "", false, 1, true);
  206. }
  207. [Test]
  208. public void ReadEmptyElement ()
  209. {
  210. RunTest (xml2, new TestMethod (ReadEmptyElement));
  211. }
  212. public void ReadEmptyElement (XmlReader reader)
  213. {
  214. reader.Read (); // root
  215. AssertEquals (false, reader.IsEmptyElement);
  216. reader.Read (); // foo
  217. AssertEquals ("foo", reader.Name);
  218. AssertEquals (true, reader.IsEmptyElement);
  219. reader.Read (); // bar
  220. AssertEquals ("bar", reader.Name);
  221. AssertEquals (false, reader.IsEmptyElement);
  222. }
  223. [Test]
  224. public void ReadStringFromElement ()
  225. {
  226. RunTest (xml3, new TestMethod (ReadStringFromElement));
  227. }
  228. public void ReadStringFromElement (XmlReader reader)
  229. {
  230. // Note: ReadString() test works only when the reader is
  231. // positioned at the container element.
  232. // In case the reader is positioned at the first
  233. // character node, XmlTextReader and XmlNodeReader works
  234. // different!!
  235. reader.Read ();
  236. string s = reader.ReadString ();
  237. AssertEquals ("readString.1.ret_val", " test of ", s);
  238. AssertEquals ("readString.1.Name", "b", reader.Name);
  239. s = reader.ReadString ();
  240. AssertEquals ("readString.2.ret_val", "mixed", s);
  241. AssertEquals ("readString.2.NodeType", XmlNodeType.EndElement, reader.NodeType);
  242. s = reader.ReadString (); // never proceeds.
  243. AssertEquals ("readString.3.ret_val", String.Empty, s);
  244. AssertEquals ("readString.3.NodeType", XmlNodeType.EndElement, reader.NodeType);
  245. reader.Read ();
  246. AssertEquals ("readString.4.NodeType", XmlNodeType.Text, reader.NodeType);
  247. AssertEquals ("readString.4.Value", " string.", reader.Value);
  248. s = reader.ReadString (); // reads the same Text node.
  249. AssertEquals ("readString.5.ret_val", " string. cdata string.", s);
  250. AssertEquals ("readString.5.NodeType", XmlNodeType.EndElement, reader.NodeType);
  251. }
  252. [Test]
  253. public void ReadInnerXml ()
  254. {
  255. const string xml = "<root><foo>test of <b>mixed</b> string.</foo><bar /></root>";
  256. RunTest (xml, new TestMethod (ReadInnerXml));
  257. }
  258. public void ReadInnerXml (XmlReader reader)
  259. {
  260. reader.Read ();
  261. reader.Read ();
  262. AssertEquals ("initial.ReadState", ReadState.Interactive, reader.ReadState);
  263. AssertEquals ("initial.EOF", false, reader.EOF);
  264. AssertEquals ("initial.NodeType", XmlNodeType.Element, reader.NodeType);
  265. string s = reader.ReadInnerXml ();
  266. AssertEquals ("read_all", "test of <b>mixed</b> string.", s);
  267. AssertEquals ("after.Name", "bar", reader.Name);
  268. AssertEquals ("after.NodeType", XmlNodeType.Element, reader.NodeType);
  269. }
  270. [Test]
  271. public void EmptyElement ()
  272. {
  273. RunTest ("<foo/>", new TestMethod (EmptyElement));
  274. }
  275. public void EmptyElement (XmlReader xmlReader)
  276. {
  277. AssertStartDocument (xmlReader);
  278. AssertNode (
  279. xmlReader, // xmlReader
  280. XmlNodeType.Element, // nodeType
  281. 0, // depth
  282. true, // isEmptyElement
  283. "foo", // name
  284. String.Empty, // prefix
  285. "foo", // localName
  286. String.Empty, // namespaceURI
  287. String.Empty, // value
  288. 0 // attributeCount
  289. );
  290. AssertEndDocument (xmlReader);
  291. }
  292. [Test]
  293. public void NestedEmptyTag ()
  294. {
  295. string xml = "<foo><bar/></foo>";
  296. RunTest (xml, new TestMethod (NestedEmptyTag));
  297. }
  298. public void NestedEmptyTag (XmlReader xmlReader)
  299. {
  300. AssertStartDocument (xmlReader);
  301. AssertNode (
  302. xmlReader, // xmlReader
  303. XmlNodeType.Element, // nodeType
  304. 0, //depth
  305. false, // isEmptyElement
  306. "foo", // name
  307. String.Empty, // prefix
  308. "foo", // localName
  309. String.Empty, // namespaceURI
  310. String.Empty, // value
  311. 0 // attributeCount
  312. );
  313. AssertNode (
  314. xmlReader, // xmlReader
  315. XmlNodeType.Element, // nodeType
  316. 1, //depth
  317. true, // isEmptyElement
  318. "bar", // name
  319. String.Empty, // prefix
  320. "bar", // localName
  321. String.Empty, // namespaceURI
  322. String.Empty, // value
  323. 0 // attributeCount
  324. );
  325. AssertNode (
  326. xmlReader, // xmlReader
  327. XmlNodeType.EndElement, // nodeType
  328. 0, //depth
  329. false, // isEmptyElement
  330. "foo", // name
  331. String.Empty, // prefix
  332. "foo", // localName
  333. String.Empty, // namespaceURI
  334. String.Empty, // value
  335. 0 // attributeCount
  336. );
  337. AssertEndDocument (xmlReader);
  338. }
  339. [Test]
  340. public void NestedText ()
  341. {
  342. string xml = "<foo>bar</foo>";
  343. RunTest (xml, new TestMethod (NestedText));
  344. }
  345. public void NestedText (XmlReader xmlReader)
  346. {
  347. AssertStartDocument (xmlReader);
  348. AssertNode (
  349. xmlReader, // xmlReader
  350. XmlNodeType.Element, // nodeType
  351. 0, //depth
  352. false, // isEmptyElement
  353. "foo", // name
  354. String.Empty, // prefix
  355. "foo", // localName
  356. String.Empty, // namespaceURI
  357. String.Empty, // value
  358. 0 // attributeCount
  359. );
  360. AssertNode (
  361. xmlReader, // xmlReader
  362. XmlNodeType.Text, // nodeType
  363. 1, //depth
  364. false, // isEmptyElement
  365. String.Empty, // name
  366. String.Empty, // prefix
  367. String.Empty, // localName
  368. String.Empty, // namespaceURI
  369. "bar", // value
  370. 0 // attributeCount
  371. );
  372. AssertNode (
  373. xmlReader, // xmlReader
  374. XmlNodeType.EndElement, // nodeType
  375. 0, //depth
  376. false, // isEmptyElement
  377. "foo", // name
  378. String.Empty, // prefix
  379. "foo", // localName
  380. String.Empty, // namespaceURI
  381. String.Empty, // value
  382. 0 // attributeCount
  383. );
  384. AssertEndDocument (xmlReader);
  385. }
  386. [Test]
  387. public void EmptyElementWithAttributes ()
  388. {
  389. string xml = @"<foo bar=""baz"" quux='quuux' x:foo='x-foo' xmlns:x = 'urn:xfoo' />";
  390. RunTest (xml, new TestMethod (EmptyElementWithAttributes ));
  391. }
  392. public void EmptyElementWithAttributes (XmlReader xmlReader)
  393. {
  394. AssertStartDocument (xmlReader);
  395. AssertNode (
  396. xmlReader, // xmlReader
  397. XmlNodeType.Element, // nodeType
  398. 0, //depth
  399. true, // isEmptyElement
  400. "foo", // name
  401. String.Empty, // prefix
  402. "foo", // localName
  403. String.Empty, // namespaceURI
  404. String.Empty, // value
  405. 4 // attributeCount
  406. );
  407. AssertAttribute (
  408. xmlReader, // xmlReader
  409. "bar", // name
  410. String.Empty, // prefix
  411. "bar", // localName
  412. String.Empty, // namespaceURI
  413. "baz" // value
  414. );
  415. AssertAttribute (
  416. xmlReader, // xmlReader
  417. "quux", // name
  418. String.Empty, // prefix
  419. "quux", // localName
  420. String.Empty, // namespaceURI
  421. "quuux" // value
  422. );
  423. AssertAttribute (
  424. xmlReader, // xmlReader
  425. "notexist", // name
  426. String.Empty, // prefix
  427. "notexist", // localName
  428. String.Empty, // namespaceURI
  429. null // value
  430. );
  431. AssertAttribute (
  432. xmlReader, // xmlReader
  433. "x:foo", // name
  434. "x", // prefix
  435. "foo", // localName
  436. "urn:xfoo", // namespaceURI
  437. "x-foo" // value
  438. );
  439. AssertAttribute (
  440. xmlReader, // xmlReader
  441. "x:bar", // name
  442. "x", // prefix
  443. "bar", // localName
  444. "urn:xfoo", // namespaceURI
  445. null // value
  446. );
  447. AssertEndDocument (xmlReader);
  448. }
  449. [Test]
  450. public void ProcessingInstructionBeforeDocumentElement ()
  451. {
  452. string xml = "<?foo bar?><baz/>";
  453. RunTest (xml, new TestMethod (ProcessingInstructionBeforeDocumentElement));
  454. }
  455. public void ProcessingInstructionBeforeDocumentElement (XmlReader xmlReader)
  456. {
  457. AssertStartDocument (xmlReader);
  458. AssertNode (
  459. xmlReader, // xmlReader
  460. XmlNodeType.ProcessingInstruction, // nodeType
  461. 0, //depth
  462. false, // isEmptyElement
  463. "foo", // name
  464. String.Empty, // prefix
  465. "foo", // localName
  466. String.Empty, // namespaceURI
  467. "bar", // value
  468. 0 // attributeCount
  469. );
  470. AssertNode (
  471. xmlReader, // xmlReader
  472. XmlNodeType.Element, // nodeType
  473. 0, //depth
  474. true, // isEmptyElement
  475. "baz", // name
  476. String.Empty, // prefix
  477. "baz", // localName
  478. String.Empty, // namespaceURI
  479. String.Empty, // value
  480. 0 // attributeCount
  481. );
  482. AssertEndDocument (xmlReader);
  483. }
  484. [Test]
  485. public void CommentBeforeDocumentElement ()
  486. {
  487. string xml = "<!--foo--><bar/>";
  488. RunTest (xml, new TestMethod (CommentBeforeDocumentElement));
  489. }
  490. public void CommentBeforeDocumentElement (XmlReader xmlReader)
  491. {
  492. AssertStartDocument (xmlReader);
  493. AssertNode (
  494. xmlReader, // xmlReader
  495. XmlNodeType.Comment, // nodeType
  496. 0, //depth
  497. false, // isEmptyElement
  498. String.Empty, // name
  499. String.Empty, // prefix
  500. String.Empty, // localName
  501. String.Empty, // namespaceURI
  502. "foo", // value
  503. 0 // attributeCount
  504. );
  505. AssertNode (
  506. xmlReader, // xmlReader
  507. XmlNodeType.Element, // nodeType
  508. 0, //depth
  509. true, // isEmptyElement
  510. "bar", // name
  511. String.Empty, // prefix
  512. "bar", // localName
  513. String.Empty, // namespaceURI
  514. String.Empty, // value
  515. 0 // attributeCount
  516. );
  517. AssertEndDocument (xmlReader);
  518. }
  519. [Test]
  520. public void PredefinedEntities ()
  521. {
  522. string xml = "<foo>&lt;&gt;&amp;&apos;&quot;</foo>";
  523. RunTest (xml, new TestMethod (PredefinedEntities));
  524. }
  525. public void PredefinedEntities (XmlReader xmlReader)
  526. {
  527. AssertStartDocument (xmlReader);
  528. AssertNode (
  529. xmlReader, // xmlReader
  530. XmlNodeType.Element, // nodeType
  531. 0, //depth
  532. false, // isEmptyElement
  533. "foo", // name
  534. String.Empty, // prefix
  535. "foo", // localName
  536. String.Empty, // namespaceURI
  537. String.Empty, // value
  538. 0 // attributeCount
  539. );
  540. AssertNode (
  541. xmlReader, // xmlReader
  542. XmlNodeType.Text, // nodeType
  543. 1, //depth
  544. false, // isEmptyElement
  545. String.Empty, // name
  546. String.Empty, // prefix
  547. String.Empty, // localName
  548. String.Empty, // namespaceURI
  549. "<>&'\"", // value
  550. 0 // attributeCount
  551. );
  552. AssertNode (
  553. xmlReader, // xmlReader
  554. XmlNodeType.EndElement, // nodeType
  555. 0, //depth
  556. false, // isEmptyElement
  557. "foo", // name
  558. String.Empty, // prefix
  559. "foo", // localName
  560. String.Empty, // namespaceURI
  561. String.Empty, // value
  562. 0 // attributeCount
  563. );
  564. AssertEndDocument (xmlReader);
  565. }
  566. [Test]
  567. public void CharacterReferences ()
  568. {
  569. string xml = "<foo>&#70;&#x4F;&#x4f;</foo>";
  570. RunTest (xml, new TestMethod (CharacterReferences));
  571. }
  572. public void CharacterReferences (XmlReader xmlReader)
  573. {
  574. AssertStartDocument (xmlReader);
  575. AssertNode (
  576. xmlReader, // xmlReader
  577. XmlNodeType.Element, // nodeType
  578. 0, //depth
  579. false, // isEmptyElement
  580. "foo", // name
  581. String.Empty, // prefix
  582. "foo", // localName
  583. String.Empty, // namespaceURI
  584. String.Empty, // value
  585. 0 // attributeCount
  586. );
  587. AssertNode (
  588. xmlReader, // xmlReader
  589. XmlNodeType.Text, // nodeType
  590. 1, //depth
  591. false, // isEmptyElement
  592. String.Empty, // name
  593. String.Empty, // prefix
  594. String.Empty, // localName
  595. String.Empty, // namespaceURI
  596. "FOO", // value
  597. 0 // attributeCount
  598. );
  599. AssertNode (
  600. xmlReader, // xmlReader
  601. XmlNodeType.EndElement, // nodeType
  602. 0, //depth
  603. false, // isEmptyElement
  604. "foo", // name
  605. String.Empty, // prefix
  606. "foo", // localName
  607. String.Empty, // namespaceURI
  608. String.Empty, // value
  609. 0 // attributeCount
  610. );
  611. AssertEndDocument (xmlReader);
  612. }
  613. [Test]
  614. public void PredefinedEntitiesInAttribute ()
  615. {
  616. string xml = "<foo bar='&lt;&gt;&amp;&apos;&quot;'/>";
  617. RunTest (xml, new TestMethod (PredefinedEntitiesInAttribute ));
  618. }
  619. public void PredefinedEntitiesInAttribute (XmlReader xmlReader)
  620. {
  621. AssertStartDocument (xmlReader);
  622. AssertNode (
  623. xmlReader, // xmlReader
  624. XmlNodeType.Element, // nodeType
  625. 0, //depth
  626. true, // isEmptyElement
  627. "foo", // name
  628. String.Empty, // prefix
  629. "foo", // localName
  630. String.Empty, // namespaceURI
  631. String.Empty, // value
  632. 1 // attributeCount
  633. );
  634. AssertAttribute (
  635. xmlReader, // xmlReader
  636. "bar", // name
  637. String.Empty, // prefix
  638. "bar", // localName
  639. String.Empty, // namespaceURI
  640. "<>&'\"" // value
  641. );
  642. AssertEndDocument (xmlReader);
  643. }
  644. [Test]
  645. public void CharacterReferencesInAttribute ()
  646. {
  647. string xml = "<foo bar='&#70;&#x4F;&#x4f;'/>";
  648. RunTest (xml, new TestMethod (CharacterReferencesInAttribute));
  649. }
  650. public void CharacterReferencesInAttribute (XmlReader xmlReader)
  651. {
  652. AssertStartDocument (xmlReader);
  653. AssertNode (
  654. xmlReader, // xmlReader
  655. XmlNodeType.Element, // nodeType
  656. 0, //depth
  657. true, // isEmptyElement
  658. "foo", // name
  659. String.Empty, // prefix
  660. "foo", // localName
  661. String.Empty, // namespaceURI
  662. String.Empty, // value
  663. 1 // attributeCount
  664. );
  665. AssertAttribute (
  666. xmlReader, // xmlReader
  667. "bar", // name
  668. String.Empty, // prefix
  669. "bar", // localName
  670. String.Empty, // namespaceURI
  671. "FOO" // value
  672. );
  673. AssertEndDocument (xmlReader);
  674. }
  675. [Test]
  676. public void CDATA ()
  677. {
  678. string xml = "<foo><![CDATA[<>&]]></foo>";
  679. RunTest (xml, new TestMethod (CDATA));
  680. }
  681. public void CDATA (XmlReader xmlReader)
  682. {
  683. AssertStartDocument (xmlReader);
  684. AssertNode (
  685. xmlReader, // xmlReader
  686. XmlNodeType.Element, // nodeType
  687. 0, //depth
  688. false, // isEmptyElement
  689. "foo", // name
  690. String.Empty, // prefix
  691. "foo", // localName
  692. String.Empty, // namespaceURI
  693. String.Empty, // value
  694. 0 // attributeCount
  695. );
  696. AssertNode (
  697. xmlReader, // xmlReader
  698. XmlNodeType.CDATA, // nodeType
  699. 1, //depth
  700. false, // isEmptyElement
  701. String.Empty, // name
  702. String.Empty, // prefix
  703. String.Empty, // localName
  704. String.Empty, // namespaceURI
  705. "<>&", // value
  706. 0 // attributeCount
  707. );
  708. AssertNode (
  709. xmlReader, // xmlReader
  710. XmlNodeType.EndElement, // nodeType
  711. 0, //depth
  712. false, // isEmptyElement
  713. "foo", // name
  714. String.Empty, // prefix
  715. "foo", // localName
  716. String.Empty, // namespaceURI
  717. String.Empty, // value
  718. 0 // attributeCount
  719. );
  720. AssertEndDocument (xmlReader);
  721. }
  722. [Test]
  723. public void EmptyElementInDefaultNamespace ()
  724. {
  725. string xml = @"<foo xmlns='http://foo/' />";
  726. RunTest (xml, new TestMethod (EmptyElementInDefaultNamespace));
  727. }
  728. public void EmptyElementInDefaultNamespace (XmlReader xmlReader)
  729. {
  730. AssertStartDocument (xmlReader);
  731. AssertNode (
  732. xmlReader, // xmlReader
  733. XmlNodeType.Element, // nodeType
  734. 0, // depth
  735. true, // isEmptyElement
  736. "foo", // name
  737. String.Empty, // prefix
  738. "foo", // localName
  739. "http://foo/", // namespaceURI
  740. String.Empty, // value
  741. 1 // attributeCount
  742. );
  743. AssertAttribute (
  744. xmlReader, // xmlReader
  745. "xmlns", // name
  746. String.Empty, // prefix
  747. "xmlns", // localName
  748. "http://www.w3.org/2000/xmlns/", // namespaceURI
  749. "http://foo/" // value
  750. );
  751. AssertEquals ("http://foo/", xmlReader.LookupNamespace (String.Empty));
  752. AssertEndDocument (xmlReader);
  753. }
  754. [Test]
  755. public void ChildElementInNamespace ()
  756. {
  757. string xml = @"<foo:bar xmlns:foo='http://foo/'><baz:quux xmlns:baz='http://baz/' /></foo:bar>";
  758. RunTest (xml, new TestMethod (ChildElementInNamespace));
  759. }
  760. public void ChildElementInNamespace (XmlReader xmlReader)
  761. {
  762. AssertStartDocument (xmlReader);
  763. AssertNode (
  764. xmlReader, // xmlReader
  765. XmlNodeType.Element, // nodeType
  766. 0, // depth
  767. false, // isEmptyElement
  768. "foo:bar", // name
  769. "foo", // prefix
  770. "bar", // localName
  771. "http://foo/", // namespaceURI
  772. String.Empty, // value
  773. 1 // attributeCount
  774. );
  775. AssertAttribute (
  776. xmlReader, // xmlReader
  777. "xmlns:foo", // name
  778. "xmlns", // prefix
  779. "foo", // localName
  780. "http://www.w3.org/2000/xmlns/", // namespaceURI
  781. "http://foo/" // value
  782. );
  783. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  784. AssertNode (
  785. xmlReader, // xmlReader
  786. XmlNodeType.Element, // nodeType
  787. 1, // depth
  788. true, // isEmptyElement
  789. "baz:quux", // name
  790. "baz", // prefix
  791. "quux", // localName
  792. "http://baz/", // namespaceURI
  793. String.Empty, // value
  794. 1 // attributeCount
  795. );
  796. AssertAttribute (
  797. xmlReader, // xmlReader
  798. "xmlns:baz", // name
  799. "xmlns", // prefix
  800. "baz", // localName
  801. "http://www.w3.org/2000/xmlns/", // namespaceURI
  802. "http://baz/" // value
  803. );
  804. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  805. AssertEquals ("http://baz/", xmlReader.LookupNamespace ("baz"));
  806. AssertNode (
  807. xmlReader, // xmlReader
  808. XmlNodeType.EndElement, // nodeType
  809. 0, // depth
  810. false, // isEmptyElement
  811. "foo:bar", // name
  812. "foo", // prefix
  813. "bar", // localName
  814. "http://foo/", // namespaceURI
  815. String.Empty, // value
  816. 0 // attributeCount
  817. );
  818. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  819. AssertNull (xmlReader.LookupNamespace ("baz"));
  820. AssertEndDocument (xmlReader);
  821. }
  822. [Test]
  823. public void ChildElementInDefaultNamespace ()
  824. {
  825. string xml = @"<foo:bar xmlns:foo='http://foo/'><baz xmlns='http://baz/' /></foo:bar>";
  826. RunTest (xml, new TestMethod (ChildElementInDefaultNamespace));
  827. }
  828. public void ChildElementInDefaultNamespace (XmlReader xmlReader)
  829. {
  830. AssertStartDocument (xmlReader);
  831. AssertNode (
  832. xmlReader, // xmlReader
  833. XmlNodeType.Element, // nodeType
  834. 0, // depth
  835. false, // isEmptyElement
  836. "foo:bar", // name
  837. "foo", // prefix
  838. "bar", // localName
  839. "http://foo/", // namespaceURI
  840. String.Empty, // value
  841. 1 // attributeCount
  842. );
  843. AssertAttribute (
  844. xmlReader, // xmlReader
  845. "xmlns:foo", // name
  846. "xmlns", // prefix
  847. "foo", // localName
  848. "http://www.w3.org/2000/xmlns/", // namespaceURI
  849. "http://foo/" // value
  850. );
  851. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  852. AssertNode (
  853. xmlReader, // xmlReader
  854. XmlNodeType.Element, // nodeType
  855. 1, // depth
  856. true, // isEmptyElement
  857. "baz", // name
  858. String.Empty, // prefix
  859. "baz", // localName
  860. "http://baz/", // namespaceURI
  861. String.Empty, // value
  862. 1 // attributeCount
  863. );
  864. AssertAttribute (
  865. xmlReader, // xmlReader
  866. "xmlns", // name
  867. String.Empty, // prefix
  868. "xmlns", // localName
  869. "http://www.w3.org/2000/xmlns/", // namespaceURI
  870. "http://baz/" // value
  871. );
  872. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  873. AssertEquals ("http://baz/", xmlReader.LookupNamespace (String.Empty));
  874. AssertNode (
  875. xmlReader, // xmlReader
  876. XmlNodeType.EndElement, // nodeType
  877. 0, // depth
  878. false, // isEmptyElement
  879. "foo:bar", // name
  880. "foo", // prefix
  881. "bar", // localName
  882. "http://foo/", // namespaceURI
  883. String.Empty, // value
  884. 0 // attributeCount
  885. );
  886. AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
  887. AssertEndDocument (xmlReader);
  888. }
  889. [Test]
  890. public void AttributeInNamespace ()
  891. {
  892. string xml = @"<foo bar:baz='quux' xmlns:bar='http://bar/' />";
  893. RunTest (xml, new TestMethod (AttributeInNamespace));
  894. }
  895. public void AttributeInNamespace (XmlReader xmlReader)
  896. {
  897. AssertStartDocument (xmlReader);
  898. AssertNode (
  899. xmlReader, // xmlReader
  900. XmlNodeType.Element, // nodeType
  901. 0, // depth
  902. true, // isEmptyElement
  903. "foo", // name
  904. String.Empty, // prefix
  905. "foo", // localName
  906. String.Empty, // namespaceURI
  907. String.Empty, // value
  908. 2 // attributeCount
  909. );
  910. AssertAttribute (
  911. xmlReader, // xmlReader
  912. "bar:baz", // name
  913. "bar", // prefix
  914. "baz", // localName
  915. "http://bar/", // namespaceURI
  916. "quux" // value
  917. );
  918. AssertAttribute (
  919. xmlReader, // xmlReader
  920. "xmlns:bar", // name
  921. "xmlns", // prefix
  922. "bar", // localName
  923. "http://www.w3.org/2000/xmlns/", // namespaceURI
  924. "http://bar/" // value
  925. );
  926. AssertEquals ("http://bar/", xmlReader.LookupNamespace ("bar"));
  927. AssertEndDocument (xmlReader);
  928. }
  929. [Test]
  930. public void MoveToElementFromAttribute ()
  931. {
  932. string xml = @"<foo bar=""baz"" />";
  933. RunTest (xml, new TestMethod (MoveToElementFromAttribute));
  934. }
  935. public void MoveToElementFromAttribute (XmlReader xmlReader)
  936. {
  937. Assert (xmlReader.Read ());
  938. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  939. Assert (xmlReader.MoveToFirstAttribute ());
  940. AssertEquals (XmlNodeType.Attribute, xmlReader.NodeType);
  941. Assert (xmlReader.MoveToElement ());
  942. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  943. }
  944. [Test]
  945. public void MoveToElementFromElement ()
  946. {
  947. string xml = @"<foo bar=""baz"" />";
  948. RunTest (xml, new TestMethod (MoveToElementFromElement));
  949. }
  950. public void MoveToElementFromElement (XmlReader xmlReader)
  951. {
  952. Assert (xmlReader.Read ());
  953. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  954. Assert (!xmlReader.MoveToElement ());
  955. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  956. }
  957. [Test]
  958. public void MoveToFirstAttributeWithNoAttributes ()
  959. {
  960. string xml = @"<foo />";
  961. RunTest (xml, new TestMethod (MoveToFirstAttributeWithNoAttributes));
  962. }
  963. public void MoveToFirstAttributeWithNoAttributes (XmlReader xmlReader)
  964. {
  965. Assert (xmlReader.Read ());
  966. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  967. Assert (!xmlReader.MoveToFirstAttribute ());
  968. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  969. }
  970. [Test]
  971. public void MoveToNextAttributeWithNoAttributes ()
  972. {
  973. string xml = @"<foo />";
  974. RunTest (xml, new TestMethod (MoveToNextAttributeWithNoAttributes));
  975. }
  976. public void MoveToNextAttributeWithNoAttributes (XmlReader xmlReader)
  977. {
  978. Assert (xmlReader.Read ());
  979. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  980. Assert (!xmlReader.MoveToNextAttribute ());
  981. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  982. }
  983. [Test]
  984. public void MoveToNextAttribute()
  985. {
  986. string xml = @"<foo bar=""baz"" quux='quuux'/>";
  987. RunTest (xml, new TestMethod (MoveToNextAttribute));
  988. }
  989. public void MoveToNextAttribute (XmlReader xmlReader)
  990. {
  991. AssertStartDocument (xmlReader);
  992. AssertNode (
  993. xmlReader, // xmlReader
  994. XmlNodeType.Element, // nodeType
  995. 0, //depth
  996. true, // isEmptyElement
  997. "foo", // name
  998. String.Empty, // prefix
  999. "foo", // localName
  1000. String.Empty, // namespaceURI
  1001. String.Empty, // value
  1002. 2 // attributeCount
  1003. );
  1004. AssertAttribute (
  1005. xmlReader, // xmlReader
  1006. "bar", // name
  1007. String.Empty, // prefix
  1008. "bar", // localName
  1009. String.Empty, // namespaceURI
  1010. "baz" // value
  1011. );
  1012. AssertAttribute (
  1013. xmlReader, // xmlReader
  1014. "quux", // name
  1015. String.Empty, // prefix
  1016. "quux", // localName
  1017. String.Empty, // namespaceURI
  1018. "quuux" // value
  1019. );
  1020. Assert (xmlReader.MoveToNextAttribute ());
  1021. AssertEquals ("bar", xmlReader.Name);
  1022. AssertEquals ("baz", xmlReader.Value);
  1023. Assert (xmlReader.MoveToNextAttribute ());
  1024. AssertEquals ("quux", xmlReader.Name);
  1025. AssertEquals ("quuux", xmlReader.Value);
  1026. Assert (!xmlReader.MoveToNextAttribute ());
  1027. Assert (xmlReader.MoveToElement ());
  1028. AssertNodeValues (
  1029. xmlReader, // xmlReader
  1030. XmlNodeType.Element, // nodeType
  1031. 0, //depth
  1032. true, // isEmptyElement
  1033. "foo", // name
  1034. String.Empty, // prefix
  1035. "foo", // localName
  1036. String.Empty, // namespaceURI
  1037. String.Empty, // value
  1038. 2 // attributeCount
  1039. );
  1040. AssertEndDocument (xmlReader);
  1041. }
  1042. [Test]
  1043. [Ignore ("XmlNodeReader never moves to xml declaration.")]
  1044. public void MoveToXmlDeclAttributes ()
  1045. {
  1046. string xml = "<?xml version=\"1.0\" standalone=\"yes\"?><root/>";
  1047. RunTest (xml, new TestMethod (MoveToXmlDeclAttributes));
  1048. }
  1049. public void MoveToXmlDeclAttributes (XmlReader xmlReader)
  1050. {
  1051. xmlReader.Read ();
  1052. this.AssertNodeValues (xmlReader,
  1053. XmlNodeType.XmlDeclaration,
  1054. 0,
  1055. false,
  1056. "xml",
  1057. String.Empty,
  1058. "xml",
  1059. String.Empty,
  1060. "version=\"1.0\" standalone=\"yes\"",
  1061. 2);
  1062. xmlReader.MoveToFirstAttribute ();
  1063. this.AssertNodeValues (xmlReader,
  1064. XmlNodeType.Attribute,
  1065. 1,
  1066. false,
  1067. "version",
  1068. String.Empty,
  1069. "version",
  1070. String.Empty,
  1071. "1.0",
  1072. 2);
  1073. xmlReader.ReadAttributeValue ();
  1074. this.AssertNodeValues (xmlReader,
  1075. XmlNodeType.Text,
  1076. 2,
  1077. false,
  1078. String.Empty,
  1079. String.Empty,
  1080. String.Empty,
  1081. String.Empty,
  1082. "1.0",
  1083. 2);
  1084. xmlReader.MoveToNextAttribute ();
  1085. this.AssertNodeValues (xmlReader,
  1086. XmlNodeType.Attribute,
  1087. 1,
  1088. false,
  1089. "standalone",
  1090. String.Empty,
  1091. "standalone",
  1092. String.Empty,
  1093. "yes",
  1094. 2);
  1095. xmlReader.ReadAttributeValue ();
  1096. this.AssertNodeValues (xmlReader,
  1097. XmlNodeType.Text,
  1098. 2,
  1099. false,
  1100. String.Empty,
  1101. String.Empty,
  1102. String.Empty,
  1103. String.Empty,
  1104. "yes",
  1105. 2);
  1106. }
  1107. [Test]
  1108. public void AttributeOrder ()
  1109. {
  1110. string xml = @"<foo _1='1' _2='2' _3='3' />";
  1111. RunTest (xml, new TestMethod (AttributeOrder));
  1112. }
  1113. public void AttributeOrder (XmlReader xmlReader)
  1114. {
  1115. Assert (xmlReader.Read ());
  1116. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  1117. Assert (xmlReader.MoveToFirstAttribute ());
  1118. AssertEquals ("_1", xmlReader.Name);
  1119. Assert (xmlReader.MoveToNextAttribute ());
  1120. AssertEquals ("_2", xmlReader.Name);
  1121. Assert (xmlReader.MoveToNextAttribute ());
  1122. AssertEquals ("_3", xmlReader.Name);
  1123. Assert (!xmlReader.MoveToNextAttribute ());
  1124. }
  1125. [Test]
  1126. public void IndexerAndAttributes ()
  1127. {
  1128. string xml = @"<?xml version='1.0' standalone='no'?><foo _1='1' _2='2' _3='3' />";
  1129. RunTest (xml, new TestMethod (IndexerAndAttributes));
  1130. }
  1131. public void IndexerAndAttributes (XmlReader xmlReader)
  1132. {
  1133. Assert (xmlReader.Read ());
  1134. AssertEquals ("1.0", xmlReader ["version"]);
  1135. AssertEquals ("1.0", xmlReader.GetAttribute ("version"));
  1136. // .NET 1.1 BUG. XmlTextReader returns null, while XmlNodeReader returns "".
  1137. AssertEquals (null, xmlReader ["encoding"]);
  1138. AssertEquals (null, xmlReader.GetAttribute ("encoding"));
  1139. AssertEquals ("no", xmlReader ["standalone"]);
  1140. AssertEquals ("no", xmlReader.GetAttribute ("standalone"));
  1141. AssertEquals ("1.0", xmlReader [0]);
  1142. AssertEquals ("1.0", xmlReader.GetAttribute (0));
  1143. AssertEquals ("no", xmlReader [1]);
  1144. AssertEquals ("no", xmlReader.GetAttribute (1));
  1145. Assert (xmlReader.Read ());
  1146. AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
  1147. AssertEquals ("1", xmlReader ["_1"]);
  1148. Assert (xmlReader.MoveToFirstAttribute ());
  1149. AssertEquals ("_1", xmlReader.Name);
  1150. AssertEquals ("1", xmlReader ["_1"]);
  1151. Assert (xmlReader.MoveToNextAttribute ());
  1152. AssertEquals ("_2", xmlReader.Name);
  1153. AssertEquals ("1", xmlReader ["_1"]);
  1154. Assert (xmlReader.MoveToNextAttribute ());
  1155. AssertEquals ("_3", xmlReader.Name);
  1156. AssertEquals ("1", xmlReader ["_1"]);
  1157. Assert (!xmlReader.MoveToNextAttribute ());
  1158. }
  1159. [Test]
  1160. public void ProhibitedMultipleAttributes ()
  1161. {
  1162. string xml = @"<foo _1='1' _1='1' />";
  1163. try {
  1164. RunTest (xml, new TestMethod (ReadAll));
  1165. } catch (XmlException) {
  1166. }
  1167. xml = @"<foo _1='1' _1='2' />";
  1168. try {
  1169. RunTest (xml, new TestMethod (ReadAll));
  1170. } catch (XmlException) {
  1171. }
  1172. }
  1173. public void ReadAll (XmlReader xmlReader)
  1174. {
  1175. while (!xmlReader.EOF)
  1176. xmlReader.Read ();
  1177. }
  1178. [Test]
  1179. public void SurrogatePairContent ()
  1180. {
  1181. string xml = "<root xmlns='&#x10100;'/>";
  1182. RunTest (xml, new TestMethod (SurrogatePairContent));
  1183. }
  1184. public void SurrogatePairContent (XmlReader xmlReader)
  1185. {
  1186. xmlReader.Read ();
  1187. AssertEquals (true, xmlReader.MoveToAttribute ("xmlns"));
  1188. AssertEquals ("xmlns", xmlReader.Name);
  1189. AssertEquals (2, xmlReader.Value.Length);
  1190. AssertEquals (0xD800, (int) xmlReader.Value [0]);
  1191. AssertEquals (0xDD00, (int) xmlReader.Value [1]);
  1192. }
  1193. }
  1194. }