| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249 |
- //
- // XmlTextReaderTests.cs
- //
- // Authors:
- // Jason Diamond ([email protected])
- // Martin Willemoes Hansen ([email protected])
- //
- // (C) 2001, 2002 Jason Diamond http://injektilo.org/
- //
- using System;
- using System.IO;
- using System.Xml;
- using System.Text;
- using NUnit.Framework;
- namespace MonoTests.System.Xml
- {
- [TestFixture]
- public class XmlTextReaderTests
- {
- private void AssertStartDocument (XmlReader xmlReader)
- {
- Assertion.Assert (xmlReader.ReadState == ReadState.Initial);
- Assertion.Assert (xmlReader.NodeType == XmlNodeType.None);
- Assertion.Assert (xmlReader.Depth == 0);
- Assertion.Assert (!xmlReader.EOF);
- }
- private void AssertNode (
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- int attributeCount)
- {
- Assertion.Assert (xmlReader.Read ());
- Assertion.Assert (xmlReader.ReadState == ReadState.Interactive);
- Assertion.Assert (!xmlReader.EOF);
- AssertNodeValues (xmlReader, nodeType, depth, isEmptyElement, name, prefix, localName, namespaceURI, value, attributeCount);
- }
- private void AssertNodeValues (
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- int attributeCount)
- {
- Assertion.AssertEquals ("NodeType", nodeType, xmlReader.NodeType);
- Assertion.AssertEquals ("Depth", depth, xmlReader.Depth);
- Assertion.AssertEquals ("IsEmptyElement", isEmptyElement, xmlReader.IsEmptyElement);
- Assertion.AssertEquals ("name", name, xmlReader.Name);
- Assertion.AssertEquals ("prefix", prefix, xmlReader.Prefix);
- Assertion.AssertEquals ("localName", localName, xmlReader.LocalName);
- Assertion.AssertEquals ("namespaceURI", namespaceURI, xmlReader.NamespaceURI);
- Assertion.AssertEquals ("hasValue", (value != String.Empty), xmlReader.HasValue);
- Assertion.AssertEquals ("Value", value, xmlReader.Value);
- Assertion.AssertEquals ("hasAttributes", attributeCount > 0, xmlReader.HasAttributes);
- Assertion.AssertEquals ("attributeCount", attributeCount, xmlReader.AttributeCount);
- }
- private void AssertAttribute (
- XmlReader xmlReader,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value)
- {
- Assertion.AssertEquals ("value", value, xmlReader [name]);
- Assertion.Assert (xmlReader.GetAttribute (name) == value);
- if (namespaceURI != String.Empty) {
- Assertion.Assert (xmlReader[localName, namespaceURI] == value);
- Assertion.Assert (xmlReader.GetAttribute (localName, namespaceURI) == value);
- }
- }
- private void AssertEndDocument (XmlReader xmlReader)
- {
- Assertion.Assert ("could read", !xmlReader.Read ());
- Assertion.AssertEquals ("NodeType is not XmlNodeType.None", XmlNodeType.None, xmlReader.NodeType);
- Assertion.AssertEquals ("Depth is not 0", 0, xmlReader.Depth);
- Assertion.AssertEquals ("ReadState is not ReadState.EndOfFile", ReadState.EndOfFile, xmlReader.ReadState);
- Assertion.Assert ("not EOF", xmlReader.EOF);
- xmlReader.Close ();
- Assertion.AssertEquals ("ReadState is not ReadState.Cosed", ReadState.Closed, xmlReader.ReadState);
- }
- // expecting parser error
- [Test]
- public void EmptyElementWithBadName ()
- {
- string xml = "<1foo/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- bool caughtXmlException = false;
- try {
- xmlReader.Read();
- } catch (XmlException) {
- caughtXmlException = true;
- }
- Assertion.Assert(caughtXmlException);
- }
- // checking parser
- [Test]
- public void EmptyElementWithStartAndEndTagWithWhitespace ()
- {
- string xml = "<foo ></foo >";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void EntityReferenceInAttribute ()
- {
- string xml = "<foo bar='&baz;'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "&baz;" // value
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void PredefinedEntitiesInAttribute ()
- {
- string xml = "<foo bar='<>&'"'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "<>&'\"" // value
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void CharacterReferencesInAttribute ()
- {
- string xml = "<foo bar='FOO'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "FOO" // value
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void CDATA ()
- {
- string xml = "<foo><![CDATA[<>&]]></foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.CDATA, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "<>&", // value
- 0 // attributeCount
- );
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void EmptyElementInNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void EmptyElementInDefaultNamespace ()
- {
- string xml = @"<foo xmlns='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace (String.Empty));
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void ChildElementInNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz:quux xmlns:baz='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz:quux", // name
- "baz", // prefix
- "quux", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:baz", // name
- "xmlns", // prefix
- "baz", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- Assertion.AssertEquals ("http://baz/", xmlReader.LookupNamespace ("baz"));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- Assertion.AssertNull (xmlReader.LookupNamespace ("baz"));
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void ChildElementInDefaultNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz xmlns='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- Assertion.AssertEquals ("http://baz/", xmlReader.LookupNamespace (String.Empty));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
- Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void AttributeInNamespace ()
- {
- string xml = @"<foo bar:baz='quux' xmlns:bar='http://bar/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "bar:baz", // name
- "bar", // prefix
- "baz", // localName
- "http://bar/", // namespaceURI
- "quux" // value
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:bar", // name
- "xmlns", // prefix
- "bar", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://bar/" // value
- );
- Assertion.AssertEquals ("http://bar/", xmlReader.LookupNamespace ("bar"));
- AssertEndDocument (xmlReader);
- }
- // The following is #if'ed out because it's specific to the Mono
- // implementation and won't compile when testing Microsoft's code.
- // Feel free to turn it on if you want to test Mono's name tables.
- #if false
- [Test]
- public void IsFirstNameCharTest ()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch) {
- Assertion.Assert (
- XmlChar.IsFirstNameChar (ch) ==
- IsFirstNameChar (ch));
- }
- }
- [Test]
- public void IsNameCharTest ()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch) {
- Assertion.Assert (
- XmlChar.IsNameChar (ch) ==
- IsNameChar (ch));
- }
- }
- private static bool IsFirstNameChar (int ch)
- {
- return
- IsLetter (ch) ||
- (ch == '_') ||
- (ch == ':');
- }
- private static bool IsNameChar (int ch)
- {
- return
- IsLetter (ch) ||
- IsDigit (ch) ||
- (ch == '.') ||
- (ch == '-') ||
- (ch == '_') ||
- (ch == ':') ||
- IsCombiningChar (ch) ||
- IsExtender (ch);
- }
- private static bool IsLetter (int ch)
- {
- return
- IsBaseChar (ch) ||
- IsIdeographic (ch);
- }
- private static bool IsBaseChar (int ch)
- {
- return
- (ch >= 0x0041 && ch <= 0x005A) ||
- (ch >= 0x0061 && ch <= 0x007A) ||
- (ch >= 0x00C0 && ch <= 0x00D6) ||
- (ch >= 0x00D8 && ch <= 0x00F6) ||
- (ch >= 0x00F8 && ch <= 0x00FF) ||
- (ch >= 0x0100 && ch <= 0x0131) ||
- (ch >= 0x0134 && ch <= 0x013E) ||
- (ch >= 0x0141 && ch <= 0x0148) ||
- (ch >= 0x014A && ch <= 0x017E) ||
- (ch >= 0x0180 && ch <= 0x01C3) ||
- (ch >= 0x01CD && ch <= 0x01F0) ||
- (ch >= 0x01F4 && ch <= 0x01F5) ||
- (ch >= 0x01FA && ch <= 0x0217) ||
- (ch >= 0x0250 && ch <= 0x02A8) ||
- (ch >= 0x02BB && ch <= 0x02C1) ||
- (ch == 0x0386) ||
- (ch >= 0x0388 && ch <= 0x038A) ||
- (ch == 0x038C) ||
- (ch >= 0x038E && ch <= 0x03A1) ||
- (ch >= 0x03A3 && ch <= 0x03CE) ||
- (ch >= 0x03D0 && ch <= 0x03D6) ||
- (ch == 0x03DA) ||
- (ch == 0x03DC) ||
- (ch == 0x03DE) ||
- (ch == 0x03E0) ||
- (ch >= 0x03E2 && ch <= 0x03F3) ||
- (ch >= 0x0401 && ch <= 0x040C) ||
- (ch >= 0x040E && ch <= 0x044F) ||
- (ch >= 0x0451 && ch <= 0x045C) ||
- (ch >= 0x045E && ch <= 0x0481) ||
- (ch >= 0x0490 && ch <= 0x04C4) ||
- (ch >= 0x04C7 && ch <= 0x04C8) ||
- (ch >= 0x04CB && ch <= 0x04CC) ||
- (ch >= 0x04D0 && ch <= 0x04EB) ||
- (ch >= 0x04EE && ch <= 0x04F5) ||
- (ch >= 0x04F8 && ch <= 0x04F9) ||
- (ch >= 0x0531 && ch <= 0x0556) ||
- (ch == 0x0559) ||
- (ch >= 0x0561 && ch <= 0x0586) ||
- (ch >= 0x05D0 && ch <= 0x05EA) ||
- (ch >= 0x05F0 && ch <= 0x05F2) ||
- (ch >= 0x0621 && ch <= 0x063A) ||
- (ch >= 0x0641 && ch <= 0x064A) ||
- (ch >= 0x0671 && ch <= 0x06B7) ||
- (ch >= 0x06BA && ch <= 0x06BE) ||
- (ch >= 0x06C0 && ch <= 0x06CE) ||
- (ch >= 0x06D0 && ch <= 0x06D3) ||
- (ch == 0x06D5) ||
- (ch >= 0x06E5 && ch <= 0x06E6) ||
- (ch >= 0x0905 && ch <= 0x0939) ||
- (ch == 0x093D) ||
- (ch >= 0x0958 && ch <= 0x0961) ||
- (ch >= 0x0985 && ch <= 0x098C) ||
- (ch >= 0x098F && ch <= 0x0990) ||
- (ch >= 0x0993 && ch <= 0x09A8) ||
- (ch >= 0x09AA && ch <= 0x09B0) ||
- (ch == 0x09B2) ||
- (ch >= 0x09B6 && ch <= 0x09B9) ||
- (ch >= 0x09DC && ch <= 0x09DD) ||
- (ch >= 0x09DF && ch <= 0x09E1) ||
- (ch >= 0x09F0 && ch <= 0x09F1) ||
- (ch >= 0x0A05 && ch <= 0x0A0A) ||
- (ch >= 0x0A0F && ch <= 0x0A10) ||
- (ch >= 0x0A13 && ch <= 0x0A28) ||
- (ch >= 0x0A2A && ch <= 0x0A30) ||
- (ch >= 0x0A32 && ch <= 0x0A33) ||
- (ch >= 0x0A35 && ch <= 0x0A36) ||
- (ch >= 0x0A38 && ch <= 0x0A39) ||
- (ch >= 0x0A59 && ch <= 0x0A5C) ||
- (ch == 0x0A5E) ||
- (ch >= 0x0A72 && ch <= 0x0A74) ||
- (ch >= 0x0A85 && ch <= 0x0A8B) ||
- (ch == 0x0A8D) ||
- (ch >= 0x0A8F && ch <= 0x0A91) ||
- (ch >= 0x0A93 && ch <= 0x0AA8) ||
- (ch >= 0x0AAA && ch <= 0x0AB0) ||
- (ch >= 0x0AB2 && ch <= 0x0AB3) ||
- (ch >= 0x0AB5 && ch <= 0x0AB9) ||
- (ch == 0x0ABD) ||
- (ch == 0x0AE0) ||
- (ch >= 0x0B05 && ch <= 0x0B0C) ||
- (ch >= 0x0B0F && ch <= 0x0B10) ||
- (ch >= 0x0B13 && ch <= 0x0B28) ||
- (ch >= 0x0B2A && ch <= 0x0B30) ||
- (ch >= 0x0B32 && ch <= 0x0B33) ||
- (ch >= 0x0B36 && ch <= 0x0B39) ||
- (ch == 0x0B3D) ||
- (ch >= 0x0B5C && ch <= 0x0B5D) ||
- (ch >= 0x0B5F && ch <= 0x0B61) ||
- (ch >= 0x0B85 && ch <= 0x0B8A) ||
- (ch >= 0x0B8E && ch <= 0x0B90) ||
- (ch >= 0x0B92 && ch <= 0x0B95) ||
- (ch >= 0x0B99 && ch <= 0x0B9A) ||
- (ch == 0x0B9C) ||
- (ch >= 0x0B9E && ch <= 0x0B9F) ||
- (ch >= 0x0BA3 && ch <= 0x0BA4) ||
- (ch >= 0x0BA8 && ch <= 0x0BAA) ||
- (ch >= 0x0BAE && ch <= 0x0BB5) ||
- (ch >= 0x0BB7 && ch <= 0x0BB9) ||
- (ch >= 0x0C05 && ch <= 0x0C0C) ||
- (ch >= 0x0C0E && ch <= 0x0C10) ||
- (ch >= 0x0C12 && ch <= 0x0C28) ||
- (ch >= 0x0C2A && ch <= 0x0C33) ||
- (ch >= 0x0C35 && ch <= 0x0C39) ||
- (ch >= 0x0C60 && ch <= 0x0C61) ||
- (ch >= 0x0C85 && ch <= 0x0C8C) ||
- (ch >= 0x0C8E && ch <= 0x0C90) ||
- (ch >= 0x0C92 && ch <= 0x0CA8) ||
- (ch >= 0x0CAA && ch <= 0x0CB3) ||
- (ch >= 0x0CB5 && ch <= 0x0CB9) ||
- (ch == 0x0CDE) ||
- (ch >= 0x0CE0 && ch <= 0x0CE1) ||
- (ch >= 0x0D05 && ch <= 0x0D0C) ||
- (ch >= 0x0D0E && ch <= 0x0D10) ||
- (ch >= 0x0D12 && ch <= 0x0D28) ||
- (ch >= 0x0D2A && ch <= 0x0D39) ||
- (ch >= 0x0D60 && ch <= 0x0D61) ||
- (ch >= 0x0E01 && ch <= 0x0E2E) ||
- (ch == 0x0E30) ||
- (ch >= 0x0E32 && ch <= 0x0E33) ||
- (ch >= 0x0E40 && ch <= 0x0E45) ||
- (ch >= 0x0E81 && ch <= 0x0E82) ||
- (ch == 0x0E84) ||
- (ch >= 0x0E87 && ch <= 0x0E88) ||
- (ch == 0x0E8A) ||
- (ch == 0x0E8D) ||
- (ch >= 0x0E94 && ch <= 0x0E97) ||
- (ch >= 0x0E99 && ch <= 0x0E9F) ||
- (ch >= 0x0EA1 && ch <= 0x0EA3) ||
- (ch == 0x0EA5) ||
- (ch == 0x0EA7) ||
- (ch >= 0x0EAA && ch <= 0x0EAB) ||
- (ch >= 0x0EAD && ch <= 0x0EAE) ||
- (ch == 0x0EB0) ||
- (ch >= 0x0EB2 && ch <= 0x0EB3) ||
- (ch == 0x0EBD) ||
- (ch >= 0x0EC0 && ch <= 0x0EC4) ||
- (ch >= 0x0F40 && ch <= 0x0F47) ||
- (ch >= 0x0F49 && ch <= 0x0F69) ||
- (ch >= 0x10A0 && ch <= 0x10C5) ||
- (ch >= 0x10D0 && ch <= 0x10F6) ||
- (ch == 0x1100) ||
- (ch >= 0x1102 && ch <= 0x1103) ||
- (ch >= 0x1105 && ch <= 0x1107) ||
- (ch == 0x1109) ||
- (ch >= 0x110B && ch <= 0x110C) ||
- (ch >= 0x110E && ch <= 0x1112) ||
- (ch == 0x113C) ||
- (ch == 0x113E) ||
- (ch == 0x1140) ||
- (ch == 0x114C) ||
- (ch == 0x114E) ||
- (ch == 0x1150) ||
- (ch >= 0x1154 && ch <= 0x1155) ||
- (ch == 0x1159) ||
- (ch >= 0x115F && ch <= 0x1161) ||
- (ch == 0x1163) ||
- (ch == 0x1165) ||
- (ch == 0x1167) ||
- (ch == 0x1169) ||
- (ch >= 0x116D && ch <= 0x116E) ||
- (ch >= 0x1172 && ch <= 0x1173) ||
- (ch == 0x1175) ||
- (ch == 0x119E) ||
- (ch == 0x11A8) ||
- (ch == 0x11AB) ||
- (ch >= 0x11AE && ch <= 0x11AF) ||
- (ch >= 0x11B7 && ch <= 0x11B8) ||
- (ch == 0x11BA) ||
- (ch >= 0x11BC && ch <= 0x11C2) ||
- (ch == 0x11EB) ||
- (ch == 0x11F0) ||
- (ch == 0x11F9) ||
- (ch >= 0x1E00 && ch <= 0x1E9B) ||
- (ch >= 0x1EA0 && ch <= 0x1EF9) ||
- (ch >= 0x1F00 && ch <= 0x1F15) ||
- (ch >= 0x1F18 && ch <= 0x1F1D) ||
- (ch >= 0x1F20 && ch <= 0x1F45) ||
- (ch >= 0x1F48 && ch <= 0x1F4D) ||
- (ch >= 0x1F50 && ch <= 0x1F57) ||
- (ch == 0x1F59) ||
- (ch == 0x1F5B) ||
- (ch == 0x1F5D) ||
- (ch >= 0x1F5F && ch <= 0x1F7D) ||
- (ch >= 0x1F80 && ch <= 0x1FB4) ||
- (ch >= 0x1FB6 && ch <= 0x1FBC) ||
- (ch == 0x1FBE) ||
- (ch >= 0x1FC2 && ch <= 0x1FC4) ||
- (ch >= 0x1FC6 && ch <= 0x1FCC) ||
- (ch >= 0x1FD0 && ch <= 0x1FD3) ||
- (ch >= 0x1FD6 && ch <= 0x1FDB) ||
- (ch >= 0x1FE0 && ch <= 0x1FEC) ||
- (ch >= 0x1FF2 && ch <= 0x1FF4) ||
- (ch >= 0x1FF6 && ch <= 0x1FFC) ||
- (ch == 0x2126) ||
- (ch >= 0x212A && ch <= 0x212B) ||
- (ch == 0x212E) ||
- (ch >= 0x2180 && ch <= 0x2182) ||
- (ch >= 0x3041 && ch <= 0x3094) ||
- (ch >= 0x30A1 && ch <= 0x30FA) ||
- (ch >= 0x3105 && ch <= 0x312C) ||
- (ch >= 0xAC00 && ch <= 0xD7A3);
- }
- private static bool IsIdeographic (int ch)
- {
- return
- (ch >= 0x4E00 && ch <= 0x9FA5) ||
- (ch == 0x3007) ||
- (ch >= 0x3021 && ch <= 0x3029);
- }
- private static bool IsDigit (int ch)
- {
- return
- (ch >= 0x0030 && ch <= 0x0039) ||
- (ch >= 0x0660 && ch <= 0x0669) ||
- (ch >= 0x06F0 && ch <= 0x06F9) ||
- (ch >= 0x0966 && ch <= 0x096F) ||
- (ch >= 0x09E6 && ch <= 0x09EF) ||
- (ch >= 0x0A66 && ch <= 0x0A6F) ||
- (ch >= 0x0AE6 && ch <= 0x0AEF) ||
- (ch >= 0x0B66 && ch <= 0x0B6F) ||
- (ch >= 0x0BE7 && ch <= 0x0BEF) ||
- (ch >= 0x0C66 && ch <= 0x0C6F) ||
- (ch >= 0x0CE6 && ch <= 0x0CEF) ||
- (ch >= 0x0D66 && ch <= 0x0D6F) ||
- (ch >= 0x0E50 && ch <= 0x0E59) ||
- (ch >= 0x0ED0 && ch <= 0x0ED9) ||
- (ch >= 0x0F20 && ch <= 0x0F29);
- }
- private static bool IsCombiningChar (int ch)
- {
- return
- (ch >= 0x0300 && ch <= 0x0345) ||
- (ch >= 0x0360 && ch <= 0x0361) ||
- (ch >= 0x0483 && ch <= 0x0486) ||
- (ch >= 0x0591 && ch <= 0x05A1) ||
- (ch >= 0x05A3 && ch <= 0x05B9) ||
- (ch >= 0x05BB && ch <= 0x05BD) ||
- (ch == 0x05BF) ||
- (ch >= 0x05C1 && ch <= 0x05C2) ||
- (ch == 0x05C4) ||
- (ch >= 0x064B && ch <= 0x0652) ||
- (ch == 0x0670) ||
- (ch >= 0x06D6 && ch <= 0x06DC) ||
- (ch >= 0x06DD && ch <= 0x06DF) ||
- (ch >= 0x06E0 && ch <= 0x06E4) ||
- (ch >= 0x06E7 && ch <= 0x06E8) ||
- (ch >= 0x06EA && ch <= 0x06ED) ||
- (ch >= 0x0901 && ch <= 0x0903) ||
- (ch == 0x093C) ||
- (ch >= 0x093E && ch <= 0x094C) ||
- (ch == 0x094D) ||
- (ch >= 0x0951 && ch <= 0x0954) ||
- (ch >= 0x0962 && ch <= 0x0963) ||
- (ch >= 0x0981 && ch <= 0x0983) ||
- (ch == 0x09BC) ||
- (ch == 0x09BE) ||
- (ch == 0x09BF) ||
- (ch >= 0x09C0 && ch <= 0x09C4) ||
- (ch >= 0x09C7 && ch <= 0x09C8) ||
- (ch >= 0x09CB && ch <= 0x09CD) ||
- (ch == 0x09D7) ||
- (ch >= 0x09E2 && ch <= 0x09E3) ||
- (ch == 0x0A02) ||
- (ch == 0x0A3C) ||
- (ch == 0x0A3E) ||
- (ch == 0x0A3F) ||
- (ch >= 0x0A40 && ch <= 0x0A42) ||
- (ch >= 0x0A47 && ch <= 0x0A48) ||
- (ch >= 0x0A4B && ch <= 0x0A4D) ||
- (ch >= 0x0A70 && ch <= 0x0A71) ||
- (ch >= 0x0A81 && ch <= 0x0A83) ||
- (ch == 0x0ABC) ||
- (ch >= 0x0ABE && ch <= 0x0AC5) ||
- (ch >= 0x0AC7 && ch <= 0x0AC9) ||
- (ch >= 0x0ACB && ch <= 0x0ACD) ||
- (ch >= 0x0B01 && ch <= 0x0B03) ||
- (ch == 0x0B3C) ||
- (ch >= 0x0B3E && ch <= 0x0B43) ||
- (ch >= 0x0B47 && ch <= 0x0B48) ||
- (ch >= 0x0B4B && ch <= 0x0B4D) ||
- (ch >= 0x0B56 && ch <= 0x0B57) ||
- (ch >= 0x0B82 && ch <= 0x0B83) ||
- (ch >= 0x0BBE && ch <= 0x0BC2) ||
- (ch >= 0x0BC6 && ch <= 0x0BC8) ||
- (ch >= 0x0BCA && ch <= 0x0BCD) ||
- (ch == 0x0BD7) ||
- (ch >= 0x0C01 && ch <= 0x0C03) ||
- (ch >= 0x0C3E && ch <= 0x0C44) ||
- (ch >= 0x0C46 && ch <= 0x0C48) ||
- (ch >= 0x0C4A && ch <= 0x0C4D) ||
- (ch >= 0x0C55 && ch <= 0x0C56) ||
- (ch >= 0x0C82 && ch <= 0x0C83) ||
- (ch >= 0x0CBE && ch <= 0x0CC4) ||
- (ch >= 0x0CC6 && ch <= 0x0CC8) ||
- (ch >= 0x0CCA && ch <= 0x0CCD) ||
- (ch >= 0x0CD5 && ch <= 0x0CD6) ||
- (ch >= 0x0D02 && ch <= 0x0D03) ||
- (ch >= 0x0D3E && ch <= 0x0D43) ||
- (ch >= 0x0D46 && ch <= 0x0D48) ||
- (ch >= 0x0D4A && ch <= 0x0D4D) ||
- (ch == 0x0D57) ||
- (ch == 0x0E31) ||
- (ch >= 0x0E34 && ch <= 0x0E3A) ||
- (ch >= 0x0E47 && ch <= 0x0E4E) ||
- (ch == 0x0EB1) ||
- (ch >= 0x0EB4 && ch <= 0x0EB9) ||
- (ch >= 0x0EBB && ch <= 0x0EBC) ||
- (ch >= 0x0EC8 && ch <= 0x0ECD) ||
- (ch >= 0x0F18 && ch <= 0x0F19) ||
- (ch == 0x0F35) ||
- (ch == 0x0F37) ||
- (ch == 0x0F39) ||
- (ch == 0x0F3E) ||
- (ch == 0x0F3F) ||
- (ch >= 0x0F71 && ch <= 0x0F84) ||
- (ch >= 0x0F86 && ch <= 0x0F8B) ||
- (ch >= 0x0F90 && ch <= 0x0F95) ||
- (ch == 0x0F97) ||
- (ch >= 0x0F99 && ch <= 0x0FAD) ||
- (ch >= 0x0FB1 && ch <= 0x0FB7) ||
- (ch == 0x0FB9) ||
- (ch >= 0x20D0 && ch <= 0x20DC) ||
- (ch == 0x20E1) ||
- (ch >= 0x302A && ch <= 0x302F) ||
- (ch == 0x3099) ||
- (ch == 0x309A);
- }
- private static bool IsExtender (int ch)
- {
- return
- (ch == 0x00B7) ||
- (ch == 0x02D0) ||
- (ch == 0x02D1) ||
- (ch == 0x0387) ||
- (ch == 0x0640) ||
- (ch == 0x0E46) ||
- (ch == 0x0EC6) ||
- (ch == 0x3005) ||
- (ch >= 0x3031 && ch <= 0x3035) ||
- (ch >= 0x309D && ch <= 0x309E) ||
- (ch >= 0x30FC && ch <= 0x30FE);
- }
- #endif
- [Test]
- public void IsName ()
- {
- Assertion.Assert (XmlReader.IsName ("foo"));
- Assertion.Assert (!XmlReader.IsName ("1foo"));
- Assertion.Assert (!XmlReader.IsName (" foo"));
- }
- [Test]
- public void IsNameToken ()
- {
- Assertion.Assert (XmlReader.IsNameToken ("foo"));
- Assertion.Assert (XmlReader.IsNameToken ("1foo"));
- Assertion.Assert (!XmlReader.IsNameToken (" foo"));
- }
- [Test]
- public void MoveToElementFromAttribute ()
- {
- string xml = @"<foo bar=""baz"" />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- Assertion.Assert (xmlReader.Read ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assertion.Assert (xmlReader.MoveToFirstAttribute ());
- Assertion.AssertEquals (XmlNodeType.Attribute, xmlReader.NodeType);
- Assertion.Assert (xmlReader.MoveToElement ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
- [Test]
- public void MoveToElementFromElement ()
- {
- string xml = @"<foo bar=""baz"" />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- Assertion.Assert (xmlReader.Read ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assertion.Assert (!xmlReader.MoveToElement ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
- [Test]
- public void MoveToFirstAttributeWithNoAttributes ()
- {
- string xml = @"<foo />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- Assertion.Assert (xmlReader.Read ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assertion.Assert (!xmlReader.MoveToFirstAttribute ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
- [Test]
- public void MoveToNextAttributeWithNoAttributes ()
- {
- string xml = @"<foo />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- Assertion.Assert (xmlReader.Read ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assertion.Assert (!xmlReader.MoveToNextAttribute ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
- [Test]
- public void MoveToNextAttribute()
- {
- string xml = @"<foo bar=""baz"" quux='quuux'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- AssertStartDocument (xmlReader);
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
- AssertAttribute (
- xmlReader, // xmlReader
- "quux", // name
- String.Empty, // prefix
- "quux", // localName
- String.Empty, // namespaceURI
- "quuux" // value
- );
- Assertion.Assert (xmlReader.MoveToNextAttribute ());
- Assertion.Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
- Assertion.Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
- Assertion.Assert (xmlReader.MoveToNextAttribute ());
- Assertion.Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
- Assertion.Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
- Assertion.Assert (!xmlReader.MoveToNextAttribute ());
- Assertion.Assert (xmlReader.MoveToElement ());
- AssertNodeValues (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void AttributeOrder ()
- {
- string xml = @"<foo _1='1' _2='2' _3='3' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- Assertion.Assert (xmlReader.Read ());
- Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assertion.Assert (xmlReader.MoveToFirstAttribute ());
- Assertion.AssertEquals ("_1", xmlReader.Name);
- Assertion.Assert (xmlReader.MoveToNextAttribute ());
- Assertion.AssertEquals ("_2", xmlReader.Name);
- Assertion.Assert (xmlReader.MoveToNextAttribute ());
- Assertion.AssertEquals ("_3", xmlReader.Name);
- Assertion.Assert (!xmlReader.MoveToNextAttribute ());
- }
- [Test]
- public void FragmentConstructor()
- {
- XmlDocument doc = new XmlDocument();
- // doc.LoadXml("<root/>");
- string xml = @"<foo><bar xmlns=""NSURI"">TEXT NODE</bar></foo>";
- MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(xml));
- XmlParserContext ctx = new XmlParserContext(doc.NameTable, new XmlNamespaceManager(doc.NameTable), "", "", "", "",
- doc.BaseURI, "", XmlSpace.Default, Encoding.Default);
- XmlTextReader xmlReader = new XmlTextReader(ms, XmlNodeType.Element, ctx);
- AssertNode(xmlReader, XmlNodeType.Element, 0, false, "foo", "", "foo", "", "", 0);
- AssertNode(xmlReader, XmlNodeType.Element, 1, false, "bar", "", "bar", "NSURI", "", 1);
- AssertNode(xmlReader, XmlNodeType.Text, 2, false, "", "", "", "NSURI", "TEXT NODE", 0);
- AssertNode(xmlReader, XmlNodeType.EndElement, 1, false, "bar", "", "bar", "NSURI", "", 0);
- AssertNode(xmlReader, XmlNodeType.EndElement, 0, false, "foo", "", "foo", "", "", 0);
- AssertEndDocument (xmlReader);
- }
- [Test]
- public void AttributeWithCharacterReference ()
- {
- string xml = @"<a value='hello & world' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- xmlReader.Read ();
- Assertion.AssertEquals ("hello & world", xmlReader ["value"]);
- }
- [Test]
- public void AttributeWithEntityReference ()
- {
- string xml = @"<a value='hello &ent; world' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- xmlReader.Read ();
- xmlReader.MoveToFirstAttribute ();
- xmlReader.ReadAttributeValue ();
- Assertion.AssertEquals ("hello ", xmlReader.Value);
- xmlReader.ReadAttributeValue ();
- Assertion.AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
- Assertion.AssertEquals ("ent", xmlReader.Name);
- Assertion.AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
- xmlReader.ReadAttributeValue ();
- Assertion.AssertEquals (" world", xmlReader.Value);
- Assertion.AssertEquals (XmlNodeType.Text, xmlReader.NodeType);
- xmlReader.ReadAttributeValue ();
- Assertion.AssertEquals (XmlNodeType.None, xmlReader.NodeType);
- xmlReader.ReadAttributeValue ();
- Assertion.AssertEquals (XmlNodeType.None, xmlReader.NodeType);
- }
- [Test]
- public void QuoteChar ()
- {
- string xml = @"<a value='hello & world' value2="""" />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
- xmlReader.Read ();
- xmlReader.MoveToFirstAttribute ();
- Assertion.AssertEquals ("First", '\'', xmlReader.QuoteChar);
- xmlReader.MoveToNextAttribute ();
- Assertion.AssertEquals ("Next", '"', xmlReader.QuoteChar);
- xmlReader.MoveToFirstAttribute ();
- Assertion.AssertEquals ("First.Again", '\'', xmlReader.QuoteChar);
- }
- [Test]
- public void ReadInnerXmlWrongInit ()
- {
- // This behavior is different from XmlNodeReader.
- XmlReader reader = new XmlTextReader (new StringReader ("<root>test of <b>mixed</b> string.</root>"));
- reader.ReadInnerXml ();
- Assertion.AssertEquals ("initial.ReadState", ReadState.Initial, reader.ReadState);
- Assertion.AssertEquals ("initial.EOF", false, reader.EOF);
- Assertion.AssertEquals ("initial.NodeType", XmlNodeType.None, reader.NodeType);
- }
- [Test]
- public void TestExternalDocument ()
- {
- XmlDocument doc = new XmlDocument ();
- doc.Load ("xmlfiles/encoding/utf-7.xml");
- }
- }
- }
|