You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(174) |
Nov
(85) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(56) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(1) |
Jul
(132) |
Aug
(5) |
Sep
|
Oct
(314) |
Nov
(133) |
Dec
(18) |
2006 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-19 07:15:17
|
Update of /cvsroot/mvp-xml/Common/v1/src/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11619/v1/src/XPath Modified Files: XPathCache.cs Log Message: Fixed bug that caused a NullReferenceException for an overload to Select. Index: XPathCache.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/XPathCache.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XPathCache.cs 27 Sep 2004 16:27:12 -0000 1.1 +++ XPathCache.cs 19 Oct 2004 07:15:07 -0000 1.2 @@ -65,7 +65,11 @@ // If we have variables, we need the dynamic context. if (variables != null) { - DynamicContext dyn = new DynamicContext(ctx); + DynamicContext dyn; + if (ctx != null) + dyn = new DynamicContext(ctx); + else + dyn = new DynamicContext(); // Add the variables we received. foreach (XPathVariable var in variables) |
From: Oleg T. <he...@us...> - 2004-10-18 19:31:34
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9039/v1/src Modified Files: XIncludingReader.cs Log Message: Working on xml:lang. Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- XIncludingReader.cs 18 Oct 2004 18:19:21 -0000 1.10 +++ XIncludingReader.cs 18 Oct 2004 19:31:24 -0000 1.11 @@ -146,9 +146,10 @@ { get { - if (_topLevel && - _reader.GetAttribute(_keywords.Base, _keywords.XmlNamespace)==null) - return _reader.AttributeCount+1; + if (_topLevel) + return _reader.AttributeCount + + _reader.GetAttribute(_keywords.XmlBase)==null?1:0 + + _reader.GetAttribute(_keywords.XmlLang)==null?1:0; else return _reader.AttributeCount; } @@ -167,6 +168,8 @@ { case XIncludingReaderState.ExposingXmlBaseAttr: case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttr: + case XIncludingReaderState.ExposingXmlLangAttrValue: return true; default: return _reader.HasValue; @@ -182,7 +185,9 @@ { case XIncludingReaderState.ExposingXmlBaseAttr: case XIncludingReaderState.ExposingXmlBaseAttrValue: - //TODO: May be wrong if xml:base exists and it does default + case XIncludingReaderState.ExposingXmlLangAttr: + case XIncludingReaderState.ExposingXmlLangAttrValue: + //TODO: May be wrong if xml:base or xml:lang exist and it does default return false; default: return _reader.IsDefault; @@ -199,7 +204,10 @@ case XIncludingReaderState.ExposingXmlBaseAttr: return _keywords.XmlBase; case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; + case XIncludingReaderState.ExposingXmlLangAttr: + return _keywords.XmlLang; default: return _reader.Name; } @@ -215,7 +223,10 @@ case XIncludingReaderState.ExposingXmlBaseAttr: return _keywords.Base; case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; + case XIncludingReaderState.ExposingXmlLangAttr: + return _keywords.Lang; default: return _reader.LocalName; } @@ -229,8 +240,10 @@ switch (_state) { case XIncludingReaderState.ExposingXmlBaseAttr: + case XIncludingReaderState.ExposingXmlLangAttr: return _keywords.XmlNamespace; case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; default: return _reader.NamespaceURI; @@ -250,8 +263,10 @@ switch (_state) { case XIncludingReaderState.ExposingXmlBaseAttr: + case XIncludingReaderState.ExposingXmlLangAttr: return XmlNodeType.Attribute; case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttrValue: return XmlNodeType.Text; default: return _reader.NodeType; @@ -266,8 +281,10 @@ switch (_state) { case XIncludingReaderState.ExposingXmlBaseAttr: + case XIncludingReaderState.ExposingXmlLangAttr: return _keywords.Xml; case XIncludingReaderState.ExposingXmlBaseAttrValue: + case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; default: return _reader.Prefix; @@ -282,6 +299,7 @@ switch (_state) { case XIncludingReaderState.ExposingXmlBaseAttr: + case XIncludingReaderState.ExposingXmlLangAttr: return '"'; default: return _reader.QuoteChar; @@ -320,6 +338,9 @@ if (_topLevel && XIncludeKeywords.Equals(name, _keywords.XmlBase)) return _reader.BaseURI; + else if (_topLevel && + XIncludeKeywords.Equals(name, _keywords.XmlLang)) + return _reader.XmlLang; else return _reader.GetAttribute(name); } @@ -330,6 +351,10 @@ XIncludeKeywords.Equals(name, _keywords.Base) && XIncludeKeywords.Equals(namespaceURI, _keywords.XmlNamespace)) return _reader.BaseURI; + else if (_topLevel && + XIncludeKeywords.Equals(name, _keywords.Lang) && + XIncludeKeywords.Equals(namespaceURI, _keywords.XmlNamespace)) + return _reader.XmlLang; else return _reader.GetAttribute(name, namespaceURI); } @@ -356,7 +381,13 @@ { _state = XIncludingReaderState.ExposingXmlBaseAttr; return true; - } + } + else if (_topLevel && + XIncludeKeywords.Equals(name, _keywords.XmlLang)) + { + _state = XIncludingReaderState.ExposingXmlLangAttr; + return true; + } else return _reader.MoveToAttribute(name); } @@ -370,6 +401,13 @@ _state = XIncludingReaderState.ExposingXmlBaseAttr; return true; } + else if (_topLevel && + XIncludeKeywords.Equals(name, _keywords.Lang) && + XIncludeKeywords.Equals(ns, _keywords.XmlNamespace)) + { + _state = XIncludingReaderState.ExposingXmlLangAttr; + return true; + } else return _reader.MoveToAttribute(name, ns); } |
From: Oleg T. <he...@us...> - 2004-10-18 18:20:00
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/src Modified Files: SR.cs SR.resx XIncludeException.cs XIncludingReader.cs Log Message: Testing... Index: XIncludeException.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludeException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- XIncludeException.cs 16 Oct 2004 21:01:37 -0000 1.4 +++ XIncludeException.cs 18 Oct 2004 18:19:21 -0000 1.5 @@ -95,4 +95,12 @@ public AttributeOrNamespaceInIncludeLocationError(string message) : base(message) {} } + /// <summary> + /// Not wellformed inclusion result (e.g. top-level xi:include + /// includes multiple elements). + /// </summary> + public class MalformedXInclusionResultError : FatalException + { + public MalformedXInclusionResultError(string message) : base(message) {} + } } Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- XIncludingReader.cs 17 Oct 2004 21:01:11 -0000 1.9 +++ XIncludingReader.cs 18 Oct 2004 18:19:21 -0000 1.10 @@ -50,7 +50,9 @@ //Top base URI private Uri _topBaseUri; //Top-level included item flag - private bool _topLevel = false; + private bool _topLevel; + //One top-level element has been included already + private bool _gotTopLevelElem; //Internal state private XIncludingReaderState _state; //Name table @@ -551,11 +553,19 @@ //If we are including and including reader is at 0 depth - //we are in top level included item _topLevel = (_readers.Count>0 && _reader.Depth == 0)? true : false; - if (_topLevel && _reader.NodeType == XmlNodeType.Attribute) - { - //Attempt to include an attribute + if (_topLevel && _reader.NodeType == XmlNodeType.Attribute) + //Attempt to include an attribute or namespace node throw new AttributeOrNamespaceInIncludeLocationError(SR.AttributeOrNamespaceInIncludeLocationError); - } + if (_topLevel && ((XmlReader)_readers.Peek()).Depth == 0 && + _reader.NodeType == XmlNodeType.Element) + { + if (_gotTopLevelElem) + //Attempt to include more than one element at the top level + throw new MalformedXInclusionResultError(SR.MalformedXInclusionResult); + else + _gotTopLevelElem = true; + } + switch (_reader.NodeType) { case XmlNodeType.XmlDeclaration: Index: SR.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/SR.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SR.cs 14 Oct 2004 13:47:07 -0000 1.2 +++ SR.cs 18 Oct 2004 18:19:21 -0000 1.3 @@ -82,6 +82,15 @@ { return SR.GetString("CustomXmlResolverError"); } + } + + /// <summary></summary> + public static string MalformedXInclusionResult + { + get + { + return SR.GetString("MalformedXInclusionResult"); + } } } Index: SR.resx =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/SR.resx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SR.resx 14 Oct 2004 13:47:07 -0000 1.2 +++ SR.resx 18 Oct 2004 18:19:21 -0000 1.3 @@ -120,4 +120,7 @@ <data name="TwoFallbacksLong" type="System.String" mimetype="System.String"> <value>xi:include element cannot contain more than one xi:fallback element. Location: {0}, Line {1}, Position {2}.</value> </data> + <data name="MalformedXInclusionResult" type="System.String" mimetype="System.String"> + <value>Malformed XInclusion result - xi:include element at the top level can't include more than one element.</value> + </data> </root> \ No newline at end of file |
From: Oleg T. <he...@us...> - 2004-10-18 18:19:33
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/test/XInclude-Test-Suite/Nist/result Modified Files: nist-include-29.xml nist-include-30.xml Log Message: Testing... Index: nist-include-30.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-30.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-30.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-30.xml 18 Oct 2004 18:19:23 -0000 1.2 @@ -1,10 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE x [ -<!ELEMENT x (family)*> -<!ELEMENT family (#PCDATA)> -<!ATTLIST family fnumber ID #REQUIRED> -<!ATTLIST family father IDREF #IMPLIED> -<!ATTLIST family mother IDREF #IMPLIED> + <!ELEMENT x (family*)> + <!ELEMENT family (#PCDATA)> + <!ATTLIST family fnumber ID #REQUIRED> + <!ATTLIST family father IDREF #IMPLIED> + <!ATTLIST family mother IDREF #IMPLIED> ]> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document with ids using a shorthand pointer. --> Index: nist-include-29.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-29.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-29.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-29.xml 18 Oct 2004 18:19:23 -0000 1.2 @@ -1,10 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE x [ -<!ELEMENT x (family)*> -<!ELEMENT family (#PCDATA)> -<!ATTLIST family fnumber ID #REQUIRED> -<!ATTLIST family father IDREF #IMPLIED> -<!ATTLIST family mother IDREF #IMPLIED> + <!ELEMENT x (family*)> + <!ELEMENT family (#PCDATA)> + <!ATTLIST family fnumber ID #REQUIRED> + <!ATTLIST family father IDREF #IMPLIED> + <!ATTLIST family mother IDREF #IMPLIED> ]> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document with ids using a shorthand pointer. --> |
From: Oleg T. <he...@us...> - 2004-10-18 18:19:32
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/test/ents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/test/XInclude-Test-Suite/Nist/test/ents Modified Files: idtst.xml Log Message: Testing... Index: idtst.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/test/ents/idtst.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- idtst.xml 29 Sep 2004 07:46:16 -0000 1.1 +++ idtst.xml 18 Oct 2004 18:19:23 -0000 1.2 @@ -1,6 +1,7 @@ <?xml version='1.0'?> <!DOCTYPE doc [ <!ELEMENT doc (family*)> + <!ELEMENT family (#PCDATA)> <!ATTLIST family fnumber ID #REQUIRED> <!ATTLIST family father IDREF #IMPLIED> <!ATTLIST family mother IDREF #IMPLIED> |
From: Oleg T. <he...@us...> - 2004-10-18 18:19:31
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/test/XInclude-Test-Suite/EdUni/test Modified Files: book.xml Log Message: Testing... Index: book.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/test/book.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- book.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ book.xml 18 Oct 2004 18:19:22 -0000 1.2 @@ -1,6 +1,9 @@ <!DOCTYPE book [ +<!ELEMENT book (intro, include*)> <!ATTLIST intro id ID #IMPLIED> <!ATTLIST include xmlns CDATA #FIXED "http://www.w3.org/2001/XInclude"> +<!ELEMENT intro (#PCDATA)> +<!ELEMENT include (#PCDATA)> ]> <book> <intro id="intro"> |
From: Oleg T. <he...@us...> - 2004-10-18 18:19:31
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/result In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/test/XInclude-Test-Suite/EdUni/result Modified Files: book.xml Log Message: Testing... Index: book.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/result/book.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- book.xml 17 Oct 2004 21:01:12 -0000 1.2 +++ book.xml 18 Oct 2004 18:19:22 -0000 1.3 @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE book [ +<!ELEMENT book (intro, include*)> <!ATTLIST intro id ID #IMPLIED> <!ATTLIST include xmlns CDATA #FIXED "http://www.w3.org/2001/XInclude"> +<!ELEMENT intro (#PCDATA)> +<!ELEMENT include (#PCDATA)> ]> <book> <intro id="intro"> |
From: Oleg T. <he...@us...> - 2004-10-18 18:19:31
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23707/v1/test Modified Files: EntryPoint.cs NistTests.cs XIncludeReaderTests.cs Log Message: Testing... Index: EntryPoint.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/EntryPoint.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EntryPoint.cs 17 Oct 2004 21:01:12 -0000 1.1 +++ EntryPoint.cs 18 Oct 2004 18:19:21 -0000 1.2 @@ -10,10 +10,11 @@ public static void Main() { //XIncludeReaderTests rt = new XIncludeReaderTests(); - EdUniTests rt = new EdUniTests(); + //EdUniTests rt = new EdUniTests(); + NistTests rt = new NistTests(); try { - rt.Test2(); + rt.Test24(); } catch (Exception e) { Index: XIncludeReaderTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeReaderTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XIncludeReaderTests.cs 17 Oct 2004 21:01:12 -0000 1.3 +++ XIncludeReaderTests.cs 18 Oct 2004 18:19:22 -0000 1.4 @@ -32,7 +32,16 @@ XmlValidatingReader vr = new XmlValidatingReader(new XmlTextReader(source)); vr.ValidationType = ValidationType.None; vr.EntityHandling = EntityHandling.ExpandEntities; - doc.Load(new XIncludingReader(vr)); + try + { + doc.Load(new XIncludingReader(vr)); + } + catch (Exception e) + { + vr.Close(); + throw e; + } + vr.Close(); XmlTextReader r1 = new XmlTextReader(new StringReader(doc.OuterXml)); r1.WhitespaceHandling = WhitespaceHandling.Significant; XmlTextReader r2 = new XmlTextReader(result); @@ -124,8 +133,7 @@ r2 = null; StreamReader sr = new StreamReader(result); string expectedResult = sr.ReadToEnd(); - sr.Close(); - XIncludingReader xir = new XIncludingReader(source); + sr.Close(); MemoryStream ms = new MemoryStream(); doc.Save(new StreamWriter(ms, Encoding.UTF8)); ms.Position = 0; @@ -135,7 +143,7 @@ throw e; } finally - { + { if (r1 != null) r1.Close(); if (r2 != null) Index: NistTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/NistTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- NistTests.cs 16 Oct 2004 21:03:15 -0000 1.1 +++ NistTests.cs 18 Oct 2004 18:19:22 -0000 1.2 @@ -245,6 +245,7 @@ /// Test should fail because is including more than one element. /// </summary> [Test] + [ExpectedException(typeof(MalformedXInclusionResultError))] public void Test23() { RunAndCompare("nist-include-23.xml", "nist-include-23.xml"); @@ -325,6 +326,7 @@ /// /// </summary> [Test] + [ExpectedException(typeof(FatalResourceException))] public void Test32() { RunAndCompare("nist-include-32.xml", "nist-include-32.xml"); @@ -334,6 +336,7 @@ /// /// </summary> [Test] + [ExpectedException(typeof(FatalResourceException))] public void Test33() { RunAndCompare("nist-include-33.xml", "nist-include-34.xml"); @@ -426,18 +429,22 @@ } /// <summary> - /// + /// Test a resource that contains not-well-formed XML. + /// This test should result in a fatal error. /// </summary> [Test] + [ExpectedException(typeof(XmlException))] public void Test44() { RunAndCompare("nist-include-44.xml", "nist-include-44.xml"); } /// <summary> - /// + /// Test a resource that contains not-well-formed XML. + /// This test should result in a fatal error. /// </summary> [Test] + [ExpectedException(typeof(XmlException))] public void Test45() { RunAndCompare("nist-include-45.xml", "nist-include-45.xml"); |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:50
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test Modified Files: XIncludeReaderTests.cs XIncludeTest.csproj Added Files: EntryPoint.cs Log Message: XInclude Test Suite stuff. Index: XIncludeTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeTest.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- XIncludeTest.csproj 16 Oct 2004 21:01:37 -0000 1.4 +++ XIncludeTest.csproj 17 Oct 2004 21:01:12 -0000 1.5 @@ -15,7 +15,7 @@ DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" - OutputType = "Library" + OutputType = "Exe" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "Mvp.Xml.XInclude.Test" @@ -100,6 +100,11 @@ BuildAction = "Compile" /> <File + RelPath = "EntryPoint.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "FourThoughtTests.cs" SubType = "Code" BuildAction = "Compile" @@ -133,6 +138,18 @@ BuildAction = "Content" /> <File + RelPath = "results\filenotfound.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\includesitself.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\nonxmlchar.xml" + BuildAction = "Content" + /> + <File RelPath = "results\working_example.xml" BuildAction = "Content" /> --- NEW FILE: EntryPoint.cs --- using System; namespace Mvp.Xml.XInclude.Test { /// <summary> /// Entry point for console application. /// </summary> public class EntryPoint { public static void Main() { //XIncludeReaderTests rt = new XIncludeReaderTests(); EdUniTests rt = new EdUniTests(); try { rt.Test2(); } catch (Exception e) { Console.WriteLine(e); } } } } Index: XIncludeReaderTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeReaderTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XIncludeReaderTests.cs 14 Oct 2004 15:17:13 -0000 1.2 +++ XIncludeReaderTests.cs 17 Oct 2004 21:01:12 -0000 1.3 @@ -21,27 +21,126 @@ Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } + /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) - { - XIncludingReader xir = new XIncludingReader(source); + { XmlDocument doc = new XmlDocument(); - doc.Load(xir); - MemoryStream ms = new MemoryStream(); - doc.Save(new StreamWriter(ms, Encoding.UTF8)); - ms.Position = 0; - string actualResult = new StreamReader(ms).ReadToEnd(); - StreamReader sr = new StreamReader(result); - string expectedResult = sr.ReadToEnd(); - sr.Close(); - if (actualResult != expectedResult) + doc.PreserveWhitespace = true; + XmlValidatingReader vr = new XmlValidatingReader(new XmlTextReader(source)); + vr.ValidationType = ValidationType.None; + vr.EntityHandling = EntityHandling.ExpandEntities; + doc.Load(new XIncludingReader(vr)); + XmlTextReader r1 = new XmlTextReader(new StringReader(doc.OuterXml)); + r1.WhitespaceHandling = WhitespaceHandling.Significant; + XmlTextReader r2 = new XmlTextReader(result); + r2.WhitespaceHandling = WhitespaceHandling.Significant; + try { - Console.WriteLine("Actual Result was {0}", actualResult); - Console.WriteLine("Expected Result was {0}", expectedResult); + while (r1.Read()) + { + Assert.IsTrue(r2.Read()); + while (r1.NodeType == XmlNodeType.XmlDeclaration || + r1.NodeType == XmlNodeType.Whitespace) + r1.Read(); + while (r2.NodeType == XmlNodeType.XmlDeclaration || + r2.NodeType == XmlNodeType.Whitespace) + r2.Read(); + switch (r1.NodeType) + { + case XmlNodeType.Attribute: + Assert.AreEqual(r2.NodeType, XmlNodeType.Attribute); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.LocalName, r2.LocalName); + Assert.AreEqual(r1.NamespaceURI, r2.NamespaceURI); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.CDATA: + Assert.AreEqual(r2.NodeType, XmlNodeType.CDATA); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.Comment: + Assert.AreEqual(r2.NodeType, XmlNodeType.Comment); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.DocumentType: + Assert.AreEqual(r2.NodeType, XmlNodeType.DocumentType); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.Element: + Assert.AreEqual(r2.NodeType, XmlNodeType.Element); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.LocalName, r2.LocalName); + Assert.AreEqual(r1.NamespaceURI, r2.NamespaceURI); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.Entity: + Assert.AreEqual(r2.NodeType, XmlNodeType.Entity); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.EndElement: + Assert.AreEqual(r2.NodeType, XmlNodeType.EndElement); + break; + case XmlNodeType.EntityReference: + Assert.AreEqual(r2.NodeType, XmlNodeType.EntityReference); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.Notation: + Assert.AreEqual(r2.NodeType, XmlNodeType.Notation); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.ProcessingInstruction: + Assert.AreEqual(r2.NodeType, XmlNodeType.ProcessingInstruction); + Assert.AreEqual(r1.Name, r2.Name); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.SignificantWhitespace: + Assert.AreEqual(r2.NodeType, XmlNodeType.SignificantWhitespace); + Assert.AreEqual(r1.Value, r2.Value); + break; + case XmlNodeType.Text: + Assert.AreEqual(r2.NodeType, XmlNodeType.Text); + Assert.AreEqual(r1.Value, r2.Value); + break; + default: + break; + } + } + Assert.IsFalse(r2.Read()); + Assert.IsTrue(r1.ReadState == ReadState.EndOfFile || r1.ReadState == ReadState.Closed); + Assert.IsTrue(r2.ReadState == ReadState.EndOfFile || r2.ReadState == ReadState.Closed); + } + catch(Exception e) + { + r1.Close(); + r1 = null; + r2.Close(); + r2 = null; + StreamReader sr = new StreamReader(result); + string expectedResult = sr.ReadToEnd(); + sr.Close(); + XIncludingReader xir = new XIncludingReader(source); + MemoryStream ms = new MemoryStream(); + doc.Save(new StreamWriter(ms, Encoding.UTF8)); + ms.Position = 0; + string actualResult = new StreamReader(ms).ReadToEnd(); + Console.WriteLine("\n-----------Expected result:-----------\n{0}", expectedResult); + Console.WriteLine("-----------Actual result:-----------\n{0}", actualResult); + throw e; + } + finally + { + if (r1 != null) + r1.Close(); + if (r2 != null) + r2.Close(); } - Assert.IsTrue(actualResult == expectedResult); } /// <summary> @@ -60,7 +159,7 @@ [ExpectedException(typeof(NonXmlCharacterException))] public void NonXMLChar() { - RunAndCompare("../../tests/nonxmlchar.xml", "../../results/result.xml"); + RunAndCompare("../../tests/nonxmlchar.xml", "../../results/nonxmlchar.xml"); } /// <summary> @@ -70,7 +169,7 @@ [ExpectedException(typeof(FatalResourceException))] public void FileNotFound() { - RunAndCompare("../../tests/filenotfound.xml", "../../results/result.xml"); + RunAndCompare("../../tests/filenotfound.xml", "../../results/filenotfound.xml"); } /// <summary> @@ -80,7 +179,7 @@ [ExpectedException(typeof(CircularInclusionException))] public void IncludesItself() { - RunAndCompare("../../tests/includesitself.xml", "../../results/result.xml"); + RunAndCompare("../../tests/includesitself.xml", "../../results/includesitself.xml"); } /// <summary> |
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test/XInclude-Test-Suite/Nist/result Modified Files: nist-include-01.xml nist-include-16.xml nist-include-18.xml nist-include-19.xml nist-include-20.xml nist-include-21.xml nist-include-22.xml nist-include-28.xml nist-include-35.xml nist-include-36.xml nist-include-37.xml nist-include-38.xml nist-include-50.xml nist-include-55.xml Log Message: XInclude Test Suite stuff. Index: nist-include-28.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-28.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-28.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-28.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE book [ -<!ELEMENT book (doc)*> -<!ELEMENT doc (isid)*> +<!ELEMENT book (doc*)> +<!ELEMENT doc (isid*)> <!ELEMENT isid EMPTY> <!ATTLIST isid myid ID #IMPLIED> ]> Index: nist-include-22.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-22.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-22.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-22.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,7 +1,6 @@ <?xml version="1.0"?> <!-- Testing when the document (top level) element in the source infoset is an include element.--> -<!DOCTYPE include> <book xml:base="../ents/books.xml"> <chapter>chapter 1. Index: nist-include-18.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-18.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-18.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-18.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Simple test of including a set of nodes from an XML document --> <chapter xml:base="../ents/books.xml">chapter 1. Index: nist-include-37.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-37.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-37.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-37.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document using XPointer Framework. If the processor does not support the scheme used in a pointer part, it skip that pointer part. --> Index: nist-include-50.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-50.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-50.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-50.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Test an include location identifying the document information item without an Xpointer, the set of top-level included item should be the children of the acquired inforset's document Index: nist-include-16.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-16.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-16.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-16.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Test the exclusion of the document type declaration information item when performing an inclusion.--> Index: nist-include-01.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-01.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-01.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-01.xml 17 Oct 2004 21:01:12 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Simple test of including another XML document --> <book xml:base="../ents/books.xml"> Index: nist-include-55.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-55.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-55.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-55.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,14 +1,16 @@ <?xml version="1.0"?> <!DOCTYPE x [ -<!ELEMENT x (xinclude:include* , view*)> +<!ELEMENT x (xinclude:include*, view*)> <!ELEMENT xinclude:include EMPTY> -<!ATTLIST xinclude:include xmlns:xinclude CDATA #FIXED "http://www.w3.org/2001/XInclude"> -<!ATTLIST xinclude:include href CDATA #REQUIRED> -<!ATTLIST xinclude:include parse (xml | text) "xml"> -<!ATTLIST xinclude:include encoding CDATA #IMPLIED> -<!ELEMENT view EMPTY> -<!ENTITY image SYSTEM "gris.jpg" NDATA jpg> -<!ATTLIST view sun ENTITY #IMPLIED> +<!ATTLIST xinclude:include + xmlns:xinclude CDATA #FIXED "http://www.w3.org/2001/XInclude" + href CDATA #REQUIRED + parse (xml|text) "xml" + encoding CDATA #IMPLIED> + <!ELEMENT view EMPTY> + <!NOTATION jpg SYSTEM "jpg"> + <!ENTITY image SYSTEM "gris.jpg" NDATA jpg> + <!ATTLIST view sun ENTITY #IMPLIED> ]> <!-- Including a duplicate unparsed entity. Test should ignore duplicate unparsed entity. --> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> Index: nist-include-35.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-35.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-35.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-35.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document with ids using XPointer element schema. --> <doc xml:base="../ents/idtst.xml"> Index: nist-include-19.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-19.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-19.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-19.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Simple test of including a set of nodes from an XML document --> <chapter xml:base="../ents/books.xml">chapter 1. Index: nist-include-38.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-38.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-38.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-38.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document using the XPointer Framework. --> <family fnumber="f2" xml:base="../ents/idtst.xml">Clark</family> Index: nist-include-36.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-36.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-36.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-36.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including another XML document with ids using XPointer element schema. --> <family fnumber="f2" xml:base="../ents/idtst.xml">Clark</family> Index: nist-include-20.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-20.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-20.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-20.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,5 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE x> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Test an include location identifying a document information item with an xpointer locating the document root. In this case Index: nist-include-21.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Nist/result/nist-include-21.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nist-include-21.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ nist-include-21.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE x [ -<!ELEMENT x (view)*> -<!ELEMENT view EMPTY> -<!ATTLIST view sun ENTITY #IMPLIED> -<!ENTITY image SYSTEM "gris.jpg" NDATA jpg> + <!ELEMENT x (view*)> + <!ELEMENT view EMPTY> + <!ATTLIST view sun ENTITY #IMPLIED> + <!NOTATION jpg SYSTEM "jpg"> + <!ENTITY image SYSTEM "gris.jpg" NDATA jpg> ]> <x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <!-- Including an XML document with an unparsed entity. --> |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:22
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test/tests Modified Files: fallback.xml Log Message: XInclude Test Suite stuff. Index: fallback.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/tests/fallback.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fallback.xml 14 Oct 2004 15:17:14 -0000 1.1 +++ fallback.xml 17 Oct 2004 21:01:13 -0000 1.2 @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> <div xmlns:xi="http://www.w3.org/2003/XInclude"> <xi:include href="no-such-file.txt" parse="text"> <xi:fallback> |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:22
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/results In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test/results Added Files: filenotfound.xml includesitself.xml nonxmlchar.xml Log Message: XInclude Test Suite stuff. --- NEW FILE: includesitself.xml --- <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>120 Mz is adequate for an average home user.</p> <foo></foo> foo </document> --- NEW FILE: filenotfound.xml --- <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>120 Mz is adequate for an average home user.</p> <foo></foo> foo </document> --- NEW FILE: nonxmlchar.xml --- <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>120 Mz is adequate for an average home user.</p> <xi:include href="binary.bin" parse="text"/> foo </document> |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:21
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/src Modified Files: XIncludingReader.cs Log Message: XInclude Test Suite stuff. Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- XIncludingReader.cs 16 Oct 2004 21:01:37 -0000 1.8 +++ XIncludingReader.cs 17 Oct 2004 21:01:11 -0000 1.9 @@ -30,6 +30,7 @@ /// <author>Oleg Tkachenko, ol...@tk...</author> /// <remarks> /// Open Issues: + /// o Outer/Inner/Xml/Text /// o Depth on included items? /// o GetAttribute(int i)? /// o MoveToAttribute(int i)? |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:21
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Imaq/result/XInclude In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test/XInclude-Test-Suite/Imaq/result/XInclude Modified Files: docids.xml Log Message: XInclude Test Suite stuff. Index: docids.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/Imaq/result/XInclude/docids.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- docids.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ docids.xml 17 Oct 2004 21:01:12 -0000 1.2 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE book [ -<!ELEMENT book (doc)*> -<!ELEMENT doc (isid)*> +<!ELEMENT book (doc*)> +<!ELEMENT doc (isid*)> <!ELEMENT isid EMPTY> <!ATTLIST isid myid ID #IMPLIED> ]> |
From: Oleg T. <he...@us...> - 2004-10-17 21:01:21
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/result In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11505/v1/test/XInclude-Test-Suite/EdUni/result Modified Files: book.xml extract.xml Log Message: XInclude Test Suite stuff. Index: extract.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/result/extract.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extract.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ extract.xml 17 Oct 2004 21:01:12 -0000 1.2 @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE extract [ +<!ATTLIST include xmlns CDATA #FIXED "http://www.w3.org/2001/XInclude"> +]> <extract> <intro id="intro" xml:base="book.xml"> You will enjoy this book. Index: book.xml =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XInclude-Test-Suite/EdUni/result/book.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- book.xml 29 Sep 2004 07:46:15 -0000 1.1 +++ book.xml 17 Oct 2004 21:01:12 -0000 1.2 @@ -1,4 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE book [ +<!ATTLIST intro id ID #IMPLIED> +<!ATTLIST include xmlns CDATA #FIXED "http://www.w3.org/2001/XInclude"> +]> <book> <intro id="intro"> You will enjoy this book. |
From: Oleg T. <he...@us...> - 2004-10-16 21:03:25
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1218/v1/test Added Files: EdUniTests.cs FourThoughtTests.cs ImaqTests.cs NistTests.cs Log Message: XInclude Test Suite stuff. --- NEW FILE: EdUniTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// Edinburgh University test cases from the XInclude Test suite. /// </summary> [TestFixture] public class EdUniTests { public EdUniTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/EdUni/test/" + source, "../../XInclude-Test-Suite/EdUni/result/" + result); } /// <summary> /// Simple whole-file inclusion. /// </summary> [Test] public void Test1() { RunAndCompare("book.xml", "book.xml"); } /// <summary> /// Verify that xi:include elements in the target have /// been processed in the acquired infoset, ie before /// the xpointer is applied. /// </summary> [Test] public void Test2() { RunAndCompare("extract.xml", "extract.xml"); } } } --- NEW FILE: ImaqTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// Redhat test cases from the XInclude Test suite. /// </summary> [TestFixture] public class ImaqTests { public ImaqTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/Imaq/test/XInclude/docs/" + source, "../../XInclude-Test-Suite/Imaq/result/XInclude/" + result); } /// <summary> /// Simple test of including another XML document. /// </summary> [Test] public void Test1() { RunAndCompare("include.xml", "include.xml"); } /// <summary> /// Test recursive inclusion. /// </summary> [Test] public void Test2() { RunAndCompare("recursive.xml", "recursive.xml"); } /// <summary> /// Simple test of including another text document. /// </summary> [Test] public void Test3() { RunAndCompare("nodes.xml", "nodes.xml"); } /// <summary> /// including another XML document with IDs. /// </summary> [Test] public void Test4() { RunAndCompare("docids.xml", "docids.xml"); } /// <summary> /// Simple test of including another text documents /// </summary> [Test] public void Test5() { RunAndCompare("txtinclude.xml", "txtinclude.xml"); } /// <summary> /// Simple test of a fallback on unavailable URI. /// </summary> [Test] public void Test6() { RunAndCompare("fallback.xml", "fallback.xml"); } } } --- NEW FILE: FourThoughtTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// FourThough test cases from the XInclude Test suite. /// </summary> [TestFixture] public class FourThoughtTests { public FourThoughtTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/FourThought/test/XInclude/docs/" + source, "../../XInclude-Test-Suite/FourThought/result/XInclude/" + result); } /// <summary> /// Simple test of including another XML document. /// </summary> [Test] public void Test1() { RunAndCompare("ft-include1.xml", "include1.xml"); } /// <summary> /// Test recursive inclusion. /// </summary> [Test] public void Test2() { RunAndCompare("ft-include2.xml", "include2.xml"); } /// <summary> /// Simple test of including another text document. /// </summary> [Test] public void Test3() { RunAndCompare("ft-include3.xml", "include3.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test4() { RunAndCompare("ft-include4.xml", "include4.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test5() { RunAndCompare("ft-include5.xml", "include5.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test6() { RunAndCompare("ft-include6.xml", "include6.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test7() { RunAndCompare("ft-include7.xml", "include7.xml"); } } } --- NEW FILE: NistTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// NIST test cases from the XInclude Test suite. /// </summary> [TestFixture] public class NistTests { public NistTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/Nist/test/docs/" + source, "../../XInclude-Test-Suite/Nist/result/" + result); } /// <summary> /// /// </summary> [Test] public void Test1() { RunAndCompare("nist-include-01.xml", "nist-include-01.xml"); } /// <summary> /// /// </summary> [Test] public void Test2() { RunAndCompare("nist-include-02.xml", "nist-include-02.xml"); } /// <summary> /// Test that values other than "xml" and "text" in the parse /// attribute of the XInclude element will generate a fatal error. /// Negative test. /// </summary> [Test] [ExpectedException(typeof(UnknownParseAttributeValueException))] public void Test3() { RunAndCompare("nist-include-03.xml", "nist-include-03.xml"); } /// <summary> /// /// </summary> [Test] public void Test4() { RunAndCompare("nist-include-04.xml", "nist-include-04.xml"); } /// <summary> /// Test a fallback element not appearing as a direct child of /// an xinclude element. A fatal error should be generated. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test5() { RunAndCompare("nist-include-05.xml", "nist-include-05.xml"); } /// <summary> /// /// </summary> [Test] public void Test6() { RunAndCompare("nist-include-06.xml", "nist-include-06.xml"); } /// <summary> /// /// </summary> [Test] public void Test7() { RunAndCompare("nist-include-07.xml", "nist-include-07.xml"); } /// <summary> /// Test that when the fallback element is missing, from the /// include element, a resource error results in a fatal error. /// Negative test. /// </summary> [Test] [ExpectedException(typeof(FatalResourceException))] public void Test8() { RunAndCompare("nist-include-08.xml", "nist-include-08.xml"); } /// <summary> /// /// </summary> [Test] public void Test9() { RunAndCompare("nist-include-09.xml", "nist-include-09.xml"); } /// <summary> /// /// </summary> [Test] public void Test10() { RunAndCompare("nist-include-10.xml", "nist-include-10.xml"); } /// <summary> /// Test a resource containing non-well-formed XML. /// The inclusion results in a fatal error. /// </summary> [Test] [ExpectedException(typeof(FatalResourceException))] public void Test11() { RunAndCompare("nist-include-11.xml", "nist-include-11.xml"); } /// <summary> /// Test that is a fatal error for an include element to contain more /// than one fallback elements. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test12() { RunAndCompare("nist-include-12.xml", "nist-include-12.xml"); } /// <summary> /// /// </summary> [Test] public void Test13() { RunAndCompare("nist-include-13.xml", "nist-include-13.xml"); } /// <summary> /// /// </summary> [Test] public void Test14() { RunAndCompare("nist-include-14.xml", "nist-include-14.xml"); } /// <summary> /// It is illegal for an include element to point to itself, /// when parse="xml". /// </summary> [Test] [ExpectedException(typeof(CircularInclusionException))] public void Test15() { RunAndCompare("nist-include-15.xml", "nist-include-15.xml"); } /// <summary> /// /// </summary> [Test] public void Test16() { RunAndCompare("nist-include-16.xml", "nist-include-16.xml"); } /// <summary> /// /// </summary> [Test] public void Test17() { RunAndCompare("nist-include-17.xml", "nist-include-17.xml"); } /// <summary> /// /// </summary> [Test] public void Test18() { RunAndCompare("nist-include-18.xml", "nist-include-18.xml"); } /// <summary> /// /// </summary> [Test] public void Test19() { RunAndCompare("nist-include-19.xml", "nist-include-19.xml"); } /// <summary> /// /// </summary> [Test] public void Test20() { RunAndCompare("nist-include-20.xml", "nist-include-20.xml"); } /// <summary> /// /// </summary> [Test] public void Test21() { RunAndCompare("nist-include-21.xml", "nist-include-21.xml"); } /// <summary> /// /// </summary> [Test] public void Test22() { RunAndCompare("nist-include-22.xml", "nist-include-22.xml"); } /// <summary> /// Testing an include element in the document (top-level) element /// in the source doc. /// Test should fail because is including more than one element. /// </summary> [Test] public void Test23() { RunAndCompare("nist-include-23.xml", "nist-include-23.xml"); } /// <summary> /// /// </summary> [Test] public void Test24() { RunAndCompare("nist-include-24.xml", "nist-include-24.xml"); } /// <summary> /// /// </summary> [Test] public void Test25() { RunAndCompare("nist-include-25.xml", "nist-include-25.xml"); } /// <summary> /// /// </summary> [Test] public void Test26() { RunAndCompare("nist-include-26.xml", "nist-include-26.xml"); } /// <summary> /// /// </summary> [Test] public void Test27() { RunAndCompare("nist-include-27.xml", "nist-include-27.xml"); } /// <summary> /// /// </summary> [Test] public void Test28() { RunAndCompare("nist-include-28.xml", "nist-include-28.xml"); } /// <summary> /// /// </summary> [Test] public void Test29() { RunAndCompare("nist-include-29.xml", "nist-include-29.xml"); } /// <summary> /// /// </summary> [Test] public void Test30() { RunAndCompare("nist-include-30.xml", "nist-include-30.xml"); } /// <summary> /// /// </summary> [Test] public void Test31() { RunAndCompare("nist-include-31.xml", "nist-include-31.xml"); } /// <summary> /// /// </summary> [Test] public void Test32() { RunAndCompare("nist-include-32.xml", "nist-include-32.xml"); } /// <summary> /// /// </summary> [Test] public void Test33() { RunAndCompare("nist-include-33.xml", "nist-include-34.xml"); } /// <summary> /// /// </summary> [Test] public void Test35() { RunAndCompare("nist-include-35.xml", "nist-include-35.xml"); } /// <summary> /// /// </summary> [Test] public void Test36() { RunAndCompare("nist-include-36.xml", "nist-include-36.xml"); } /// <summary> /// /// </summary> [Test] public void Test37() { RunAndCompare("nist-include-37.xml", "nist-include-37.xml"); } /// <summary> /// /// </summary> [Test] public void Test38() { RunAndCompare("nist-include-38.xml", "nist-include-38.xml"); } /// <summary> /// /// </summary> [Test] public void Test39() { RunAndCompare("nist-include-39.xml", "nist-include-39.xml"); } /// <summary> /// /// </summary> [Test] public void Test40() { RunAndCompare("nist-include-40.xml", "nist-include-40.xml"); } /// <summary> /// The content of the include element is another /// include element, this test should result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test41() { RunAndCompare("nist-include-41.xml", "nist-include-41.xml"); } /// <summary> /// Testing the content of the xinclude element. This test should result /// in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test42() { RunAndCompare("nist-include-42.xml", "nist-include-42.xml"); } /// <summary> /// Testing the content of the xinclude element. This test /// should result in a fatal error. The content must be one fallback. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test43() { RunAndCompare("nist-include-43.xml", "nist-include-43.xml"); } /// <summary> /// /// </summary> [Test] public void Test44() { RunAndCompare("nist-include-44.xml", "nist-include-44.xml"); } /// <summary> /// /// </summary> [Test] public void Test45() { RunAndCompare("nist-include-45.xml", "nist-include-45.xml"); } /// <summary> /// Testing the content of the xinclude element. The xinclude element /// may contain a fallback element; other elements from the /// xinclude namespace result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test46() { RunAndCompare("nist-include-46.xml", "nist-include-46.xml"); } /// <summary> /// Testing the content of the xinclude element. The xinclude /// element may contain a fallback element; other elements from /// the xinclude namespace result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test47() { RunAndCompare("nist-include-47.xml", "nist-include-47.xml"); } /// <summary> /// /// </summary> [Test] public void Test48() { RunAndCompare("nist-include-48.xml", "nist-include-48.xml"); } /// <summary> /// /// </summary> [Test] public void Test49() { RunAndCompare("nist-include-49.xml", "nist-include-49.xml"); } /// <summary> /// /// </summary> [Test] public void Test50() { RunAndCompare("nist-include-50.xml", "nist-include-50.xml"); } /// <summary> /// /// </summary> [Test] public void Test51() { RunAndCompare("nist-include-51.xml", "nist-include-51.xml"); } /// <summary> /// /// </summary> [Test] public void Test52() { RunAndCompare("nist-include-52.xml", "nist-include-52.xml"); } /// <summary> /// Test that an include location identifying an attribute node /// will result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Test53() { RunAndCompare("nist-include-53.xml", "nist-include-53.xml"); } /// <summary> /// Test that an include location identifying an attribute node /// will result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Test54() { RunAndCompare("nist-include-54.xml", "nist-include-54.xml"); } /// <summary> /// /// </summary> [Test] public void Test55() { RunAndCompare("nist-include-55.xml", "nist-include-55.xml"); } /// <summary> /// /// </summary> [Test] public void Test56() { RunAndCompare("nist-include-56.xml", "nist-include-56.xml"); } } } |
From: Oleg T. <he...@us...> - 2004-10-16 21:01:46
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv808/v1/src Modified Files: XIncludeException.cs XIncludingReader.cs Log Message: Renamed SyntaxError. XInclude Test Suite stuff. Index: XIncludeException.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludeException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XIncludeException.cs 14 Oct 2004 13:47:07 -0000 1.3 +++ XIncludeException.cs 16 Oct 2004 21:01:37 -0000 1.4 @@ -84,8 +84,8 @@ /// <summary> /// XInclude syntax error exception. /// </summary> - public class SyntaxError : FatalException { - public SyntaxError(string message) : base(message) {} + public class XIncludeSyntaxError : FatalException { + public XIncludeSyntaxError(string message) : base(message) {} } /// <summary> Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- XIncludingReader.cs 14 Oct 2004 13:47:07 -0000 1.7 +++ XIncludingReader.cs 16 Oct 2004 21:01:37 -0000 1.8 @@ -600,13 +600,13 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError( + throw new XIncludeSyntaxError( SR.GetString("FallbackNotChildOfIncludeLong", _reader.BaseURI.ToString(), li.LineNumber, li.LinePosition)); } else - throw new SyntaxError( + throw new XIncludeSyntaxError( SR.GetString("FallbackNotChildOfInclude", _reader.BaseURI.ToString())); } @@ -976,12 +976,12 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError(SR.GetString("IncludeChildOfIncludeLong", + throw new XIncludeSyntaxError(SR.GetString("IncludeChildOfIncludeLong", BaseURI.ToString(), li.LineNumber, li.LinePosition)); } else - throw new SyntaxError(SR.GetString("IncludeChildOfInclude", + throw new XIncludeSyntaxError(SR.GetString("IncludeChildOfInclude", BaseURI.ToString())); } if (IsFallbackElement(_reader)) @@ -993,12 +993,12 @@ if (li != null && li.HasLineInfo()) { //Two xi:fallback - throw new SyntaxError(SR.GetString("TwoFallbacksLong", + throw new XIncludeSyntaxError(SR.GetString("TwoFallbacksLong", BaseURI.ToString(), li.LineNumber, li.LinePosition)); } else - throw new SyntaxError(SR.GetString("TwoFallbacks", BaseURI.ToString())); + throw new XIncludeSyntaxError(SR.GetString("TwoFallbacks", BaseURI.ToString())); } if (_reader.IsEmptyElement) { @@ -1049,12 +1049,12 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError(SR.GetString("IncludeChildOfIncludeLong", + throw new XIncludeSyntaxError(SR.GetString("IncludeChildOfIncludeLong", _reader.BaseURI.ToString(), li.LineNumber, li.LinePosition)); } else - throw new SyntaxError(SR.GetString("IncludeChildOfInclude", + throw new XIncludeSyntaxError(SR.GetString("IncludeChildOfInclude", _reader.BaseURI.ToString())); } if (IsFallbackElement(_reader)) @@ -1066,12 +1066,12 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError(SR.GetString("TwoFallbacksLong", + throw new XIncludeSyntaxError(SR.GetString("TwoFallbacksLong", _reader.BaseURI.ToString(), li.LineNumber, li.LinePosition)); } else - throw new SyntaxError(SR.GetString("TwoFallbacks", _reader.BaseURI.ToString())); + throw new XIncludeSyntaxError(SR.GetString("TwoFallbacks", _reader.BaseURI.ToString())); } else { |
From: Oleg T. <he...@us...> - 2004-10-16 21:01:46
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv808/v1/test Modified Files: XIncludeSyntaxTests.cs XIncludeTest.csproj Log Message: Renamed SyntaxError. XInclude Test Suite stuff. Index: XIncludeTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeTest.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XIncludeTest.csproj 14 Oct 2004 15:17:13 -0000 1.3 +++ XIncludeTest.csproj 16 Oct 2004 21:01:37 -0000 1.4 @@ -95,6 +95,26 @@ <Files> <Include> <File + RelPath = "EdUniTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "FourThoughtTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ImaqTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NistTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "XIncludeReaderTests.cs" SubType = "Code" BuildAction = "Compile" Index: XIncludeSyntaxTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeSyntaxTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XIncludeSyntaxTests.cs 13 Oct 2004 17:46:59 -0000 1.1 +++ XIncludeSyntaxTests.cs 16 Oct 2004 21:01:37 -0000 1.2 @@ -34,7 +34,7 @@ /// xi:include child of xi:include. /// </summary> [Test] - [ExpectedException(typeof(SyntaxError))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void IncludeChildOfInclude() { XIncludingReader xir = new XIncludingReader("../../tests/includechildofinclude.xml"); @@ -46,7 +46,7 @@ /// xi:fallback not child of xi:include. /// </summary> [Test] - [ExpectedException(typeof(SyntaxError))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void FallbackNotChildOfInclude() { XIncludingReader xir = new XIncludingReader("../../tests/fallbacknotchildinclude.xml"); @@ -70,7 +70,7 @@ /// Two xi:fallback. /// </summary> [Test] - [ExpectedException(typeof(SyntaxError))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void TwoFallbacks() { XIncludingReader xir = new XIncludingReader("../../tests/twofallbacks.xml"); |
Update of /cvsroot/mvp-xml/XInclude/v1/test/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13400/v1/test/tests Added Files: count.txt data.xml fallback.xml resolver.xml test2.xml working_example.xml working_example2.xml xpointer.xml Log Message: Basic XInclude tests. --- NEW FILE: working_example2.xml --- <?xml version='1.0'?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>The following is the source of the "data.xml" resource:</p> <example><xi:include href="data.xml" parse="text"/></example> </document> --- NEW FILE: resolver.xml --- <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <p>Raw data from cache:</p> <xi:include href="cache://source.xml"/> <p>Filtered:</p> <xi:include href="cache://source.xml" xpointer="xpointer(//warehouse)"/> </document> --- NEW FILE: xpointer.xml --- <?xml version='1.0'?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <p>120 Mz is adequate for an average home user.</p> <xi:include href="test2.xml" xpointer="f1"/> </document> --- NEW FILE: fallback.xml --- <div xmlns:xi="http://www.w3.org/2003/XInclude"> <xi:include href="no-such-file.txt" parse="text"> <xi:fallback> <xi:include href="and-no-such-one.txt" parse="text"> <xi:fallback><a href="mailto:bo...@ex...">Report error</a></xi:fallback> </xi:include> </xi:fallback> </xi:include> </div> --- NEW FILE: count.txt --- 324387 --- NEW FILE: working_example.xml --- <?xml version='1.0'?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>This document has been accessed <xi:include href="count.txt" parse="text"/> times.</p> </document> --- NEW FILE: data.xml --- <?xml version='1.0'?> <data> <item><![CDATA[Brooks & Shields]]></item> </data> --- NEW FILE: test2.xml --- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE toinclude [ <!ELEMENT book (#PCDATA)> <!ATTLIST book id ID #IMPLIED > <!ELEMENT toinclude (book)> ]> <toinclude xmlns="foo.bar#"> <book id="f1">Books</book> </toinclude> |
From: Oleg T. <he...@us...> - 2004-10-14 15:17:26
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/results In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13400/v1/test/results Added Files: document.xml fallback.xml working_example.xml working_example2.xml xpointer.xml Log Message: Basic XInclude tests. --- NEW FILE: working_example2.xml --- <?xml version="1.0" encoding="utf-8"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>The following is the source of the "data.xml" resource:</p> <example><?xml version='1.0'?> <data> <item><![CDATA[Brooks & Shields]]></item> </data></example> </document> --- NEW FILE: working_example.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: document.xml --- <?xml version="1.0" encoding="utf-8"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>120 Mz is adequate for an average home user.</p> <!-- comment --> <?pi foo ?> <disclaimer xml:base="disclaimer.xml"> <p>The opinions represented herein represent those of the individual and should not be interpreted as official policy endorsed by this organization.</p> </disclaimer> foo </document> --- NEW FILE: xpointer.xml --- <?xml version="1.0" encoding="utf-8"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <p>120 Mz is adequate for an average home user.</p> <book id="f1" xml:base="test2.xml" xmlns="foo.bar#">Books</book> </document> --- NEW FILE: fallback.xml --- <?xml version="1.0" encoding="utf-8"?> <div xmlns:xi="http://www.w3.org/2003/XInclude"> <a href="mailto:bo...@ex...">Report error</a> </div> |
From: Oleg T. <he...@us...> - 2004-10-14 15:17:26
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13400/v1/test Modified Files: XIncludeReaderTests.cs XIncludeTest.csproj Log Message: Basic XInclude tests. Index: XIncludeTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeTest.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XIncludeTest.csproj 13 Oct 2004 17:46:59 -0000 1.2 +++ XIncludeTest.csproj 14 Oct 2004 15:17:13 -0000 1.3 @@ -105,10 +105,38 @@ BuildAction = "Compile" /> <File + RelPath = "results\document.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\fallback.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\working_example.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\working_example2.xml" + BuildAction = "Content" + /> + <File + RelPath = "results\xpointer.xml" + BuildAction = "Content" + /> + <File RelPath = "tests\binary.bin" BuildAction = "None" /> <File + RelPath = "tests\count.txt" + BuildAction = "Content" + /> + <File + RelPath = "tests\data.xml" + BuildAction = "Content" + /> + <File RelPath = "tests\disclaimer.xml" BuildAction = "Content" /> @@ -117,6 +145,10 @@ BuildAction = "Content" /> <File + RelPath = "tests\fallback.xml" + BuildAction = "Content" + /> + <File RelPath = "tests\fallbacknotchildinclude.xml" BuildAction = "Content" /> @@ -141,7 +173,11 @@ BuildAction = "Content" /> <File - RelPath = "tests\result.xml" + RelPath = "tests\resolver.xml" + BuildAction = "Content" + /> + <File + RelPath = "tests\test2.xml" BuildAction = "Content" /> <File @@ -153,6 +189,18 @@ BuildAction = "Content" /> <File + RelPath = "tests\working_example.xml" + BuildAction = "Content" + /> + <File + RelPath = "tests\working_example2.xml" + BuildAction = "Content" + /> + <File + RelPath = "tests\xpointer.xml" + BuildAction = "Content" + /> + <File RelPath = "XInclude-Test-Suite\README.cvs" BuildAction = "None" /> Index: XIncludeReaderTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeReaderTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XIncludeReaderTests.cs 13 Oct 2004 17:46:59 -0000 1.1 +++ XIncludeReaderTests.cs 14 Oct 2004 15:17:13 -0000 1.2 @@ -50,7 +50,7 @@ [Test] public void ItWorksAtLeast() { - RunAndCompare("../../tests/document.xml", "../../tests/result.xml"); + RunAndCompare("../../tests/document.xml", "../../results/document.xml"); } /// <summary> @@ -60,7 +60,7 @@ [ExpectedException(typeof(NonXmlCharacterException))] public void NonXMLChar() { - RunAndCompare("../../tests/nonxmlchar.xml", "../../tests/result.xml"); + RunAndCompare("../../tests/nonxmlchar.xml", "../../results/result.xml"); } /// <summary> @@ -70,7 +70,7 @@ [ExpectedException(typeof(FatalResourceException))] public void FileNotFound() { - RunAndCompare("../../tests/filenotfound.xml", "../../tests/result.xml"); + RunAndCompare("../../tests/filenotfound.xml", "../../results/result.xml"); } /// <summary> @@ -80,7 +80,53 @@ [ExpectedException(typeof(CircularInclusionException))] public void IncludesItself() { - RunAndCompare("../../tests/includesitself.xml", "../../tests/result.xml"); + RunAndCompare("../../tests/includesitself.xml", "../../results/result.xml"); + } + + /// <summary> + /// Text inclusion. + /// </summary> + [Test] + public void TextInclusion() + { + RunAndCompare("../../tests/working_example.xml", "../../results/working_example.xml"); + } + + /// <summary> + /// Text inclusion. + /// </summary> + [Test] + public void TextInclusion2() + { + RunAndCompare("../../tests/working_example2.xml", "../../results/working_example2.xml"); + } + + /// <summary> + /// Fallback. + /// </summary> + [Test] + public void Fallback() + { + RunAndCompare("../../tests/fallback.xml", "../../results/fallback.xml"); } + + /// <summary> + /// XPointer. + /// </summary> + [Test] + public void XPointer() + { + RunAndCompare("../../tests/xpointer.xml", "../../results/xpointer.xml"); + } + +// /// <summary> +// /// Custom resolver test. +// /// </summary> +// [Test] +// public void CustomResolver() +// { +// RunAndCompare("../../tests/resolver.xml", "../../results/resolver.xml"); +// } + } } |
From: Oleg T. <he...@us...> - 2004-10-14 15:16:14
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/results In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13144/results Log Message: Directory /cvsroot/mvp-xml/XInclude/v1/test/results added to the repository |
From: Oleg T. <he...@us...> - 2004-10-14 14:28:32
|
Update of /cvsroot/mvp-xml/XInclude/v1/test/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv408/v1/test/tests Removed Files: result.xml Log Message: Moved to the "results" folder. --- result.xml DELETED --- |
From: Oleg T. <he...@us...> - 2004-10-14 14:18:05
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30257/v1/src Modified Files: TextIncludingReader.cs XIncludeKeywords.cs XIncludingReaderState.cs Log Message: Support for xml:lang Index: TextIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/TextIncludingReader.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TextIncludingReader.cs 14 Oct 2004 13:47:07 -0000 1.3 +++ TextIncludingReader.cs 14 Oct 2004 14:17:55 -0000 1.4 @@ -225,7 +225,8 @@ enc = Encoding.GetEncoding(_encoding); } catch (Exception e) { - throw new ResourceException(SR.GetString("NotSupportedEncoding", _encoding), e); + throw new ResourceException(SR.GetString("NotSupportedEncoding", + _encoding), e); } reader = new StreamReader(stream, enc); } @@ -237,7 +238,8 @@ } catch (ResourceException re) { throw re; } catch (OutOfMemoryException oome) { - //Crazy include - memory is out - what about reading by chunks? + //Crazy include - memory is out + //TODO: what about reading by chunks? throw new ResourceException(SR.GetString("OutOfMemoryWhileFetchingResource", _href), oome); } catch (IOException ioe) { throw new ResourceException(SR.GetString("IOErrorWhileFetchingResource", _href), ioe); Index: XIncludingReaderState.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReaderState.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XIncludingReaderState.cs 29 Sep 2004 21:26:28 -0000 1.2 +++ XIncludingReaderState.cs 14 Oct 2004 14:17:55 -0000 1.3 @@ -10,6 +10,10 @@ //xml:base attribute is being exposed ExposingXmlBaseAttr, //xml:base attribute value is being exposed - ExposingXmlBaseAttrValue + ExposingXmlBaseAttrValue, + //xml:lang attribute is being exposed + ExposingXmlLangAttr, + //xml:lang attribute value is being exposed + ExposingXmlLangAttrValue } } Index: XIncludeKeywords.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludeKeywords.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XIncludeKeywords.cs 29 Sep 2004 21:26:28 -0000 1.2 +++ XIncludeKeywords.cs 14 Oct 2004 14:17:55 -0000 1.3 @@ -48,6 +48,8 @@ private const string s_XmlNamespace = "http://www.w3.org/XML/1998/namespace"; private const string s_Base = "base"; private const string s_XmlBase = "xml:base"; + private const string s_Lang = "lang"; + private const string s_XmlLang = "xml:lang"; #endregion @@ -72,6 +74,8 @@ private string _XmlNamespace; private string _Base; private string _XmlBase; + private string _Lang; + private string _XmlLang; #endregion @@ -194,6 +198,28 @@ } } + // Lang + public string Lang + { + get + { + if (_Lang == null) + _Lang = nameTable.Add(s_Lang); + return _Lang; + } + } + + // xml:lang + public string XmlLang + { + get + { + if (_XmlLang == null) + _XmlLang = nameTable.Add(s_XmlLang); + return _XmlLang; + } + } + #endregion #region public methods |
From: Oleg T. <he...@us...> - 2004-10-14 13:47:18
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22558/v1/src Modified Files: SR.cs SR.resx TextIncludingReader.cs XIncludeException.cs XIncludingReader.cs Log Message: Externalized strings. Index: XIncludeException.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludeException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XIncludeException.cs 29 Sep 2004 21:26:28 -0000 1.2 +++ XIncludeException.cs 14 Oct 2004 13:47:07 -0000 1.3 @@ -50,10 +50,9 @@ /// </summary> public class UnknownParseAttributeValueException : FatalException { public UnknownParseAttributeValueException(string attrValue) : - base("Unknown 'parse' attribute value: '" + attrValue + "'.") {} + base(SR.GetString("UnknownParseAttrValue", attrValue)) {} public UnknownParseAttributeValueException(string attrValue, string uri, int line, int position) : - base("Unknown 'parse' attribute value: '" + attrValue + "'." - + uri + ", Line " + line + ", Position " + position) {} + base(SR.GetString("UnknownParseAttrValueLong", attrValue, uri, line, position)) {} } /// <summary> @@ -61,7 +60,7 @@ /// </summary> public class NonXmlCharacterException : FatalException { public NonXmlCharacterException(char c) : - base("Included document contains forbidden in XML character: 0x"+ ((int)c).ToString("X2")) {} + base(SR.GetString("NonXmlCharacter", ((int)c).ToString("X2"))) {} } /// <summary> @@ -69,10 +68,9 @@ /// </summary> public class CircularInclusionException : FatalException { public CircularInclusionException(Uri uri) : - base("Circular inclusion has been detected, inclusion location: " + uri.AbsoluteUri) {} + base(SR.GetString("CircularInclusion", uri.AbsoluteUri)) {} public CircularInclusionException(Uri uri, string locationUri, int line, int position) : - base("Circular inclusion has been detected, inclusion location: " + uri.AbsoluteUri + "." - + locationUri + ", Line " + line + ", Position " + position) {} + base(SR.GetString("CircularInclusionLong", uri.AbsoluteUri, locationUri, line, position)) {} } /// <summary> @@ -80,7 +78,7 @@ /// </summary> public class FatalResourceException : FatalException { public FatalResourceException(Exception re) : - base("Resource error has occured and no fallback has been provided: " + re.Message, re) {} + base(SR.GetString("FatalResourceException", re.Message), re) {} } /// <summary> Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- XIncludingReader.cs 13 Oct 2004 17:46:59 -0000 1.6 +++ XIncludingReader.cs 14 Oct 2004 13:47:07 -0000 1.7 @@ -553,7 +553,7 @@ if (_topLevel && _reader.NodeType == XmlNodeType.Attribute) { //Attempt to include an attribute - throw new AttributeOrNamespaceInIncludeLocationError("Include location identifies an attribute or namespace node!"); + throw new AttributeOrNamespaceInIncludeLocationError(SR.AttributeOrNamespaceInIncludeLocationError); } switch (_reader.NodeType) { @@ -600,11 +600,15 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError("xi:fallback element must be direct child of xi:include element." - + _reader.BaseURI.ToString() + ", Line " + li.LineNumber + ", Position " + li.LinePosition); + throw new SyntaxError( + SR.GetString("FallbackNotChildOfIncludeLong", + _reader.BaseURI.ToString(), li.LineNumber, + li.LinePosition)); } else - throw new SyntaxError("xi:fallback element must be direct child of xi:include element." + _reader.BaseURI.ToString()); + throw new SyntaxError( + SR.GetString("FallbackNotChildOfInclude", + _reader.BaseURI.ToString())); } else goto default; @@ -733,11 +737,11 @@ } catch (NotSupportedException nse) { - throw new ResourceException("URI schema is not supported: '" + href + "'", nse); + throw new ResourceException(SR.GetString("URISchemaNotSupported", href), nse); } catch (SecurityException se) { - throw new ResourceException("Security exception while fetching '" + href + "'", se); + throw new ResourceException(SR.GetString("SecurityException", href), se); } //Add accept headers if this is HTTP request HttpWebRequest httpReq = wReq as HttpWebRequest; @@ -752,6 +756,7 @@ } if (acceptLanguage != null) { + //TODO: WTF??? httpReq.Headers.Add("Accept-Language", "ru"); if (httpReq.Headers["Accept-Language"] == null) httpReq.Headers.Add("Accept-Language", acceptLanguage); @@ -765,7 +770,7 @@ } catch (WebException we) { - throw new ResourceException("Resource '" + href + "' cannot be fetched", we); + throw new ResourceException(SR.GetString("ResourceError", href), we); } return response.GetResponseStream(); } @@ -785,16 +790,20 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new MissingHrefAndXpointerException("'href' or 'xpointer' attribute is required on xi:include element. " - + _reader.BaseURI.ToString() + ", Line " + li.LineNumber + ", Position " + li.LinePosition); + throw new MissingHrefAndXpointerException( + SR.GetString("MissingHrefAndXpointerExceptionLong", + _reader.BaseURI.ToString(), + li.LineNumber, li.LinePosition)); } else - throw new MissingHrefAndXpointerException("'href' or 'xpointer' attribute is required on xi:include element. " + _reader.BaseURI.ToString()); + throw new MissingHrefAndXpointerException( + SR.GetString("MissingHrefAndXpointerException", + _reader.BaseURI.ToString())); } else { //No href - intra-document reference - throw new NotImplementedException("Intra-document references are not implemented yet!"); + throw new NotImplementedException(SR.IntradocumentReferencesNotSupported); } } string parse = _reader.GetAttribute(_keywords.Parse); @@ -836,10 +845,10 @@ } catch (Exception e) { - throw new ResourceException("An exception has occured during GetEntity call to custom XmlResolver", e); + throw new ResourceException(SR.CustomXmlResolverError, e); } if (resource == null) - throw new ResourceException("Custom XmlResolver returned null"); + throw new ResourceException(SR.CustomXmlResolverReturnedNull); //Ok, we accept Stream and XmlReader only XmlReader r; if (resource is Stream) @@ -848,7 +857,9 @@ r = (XmlReader)resource; else //Unsupported type - throw new ResourceException("Custom XmlResolver returned object of unsupported type."); + throw new ResourceException(SR.GetString( + "CustomXmlResolverReturnedUnsupportedType", + resource.GetType().ToString())); //Push new base URI to the stack _baseURIs.Push(includeLocation); //Push current reader to the stack @@ -907,11 +918,11 @@ } catch(UriFormatException ufe) { - throw new ResourceException("Invalid URI '" + href + "'", ufe); + throw new ResourceException(SR.GetString("InvalidURI", href), ufe); } catch (Exception e) { - throw new ResourceException("Unable to resolve URI reference '" + href + "'", e); + throw new ResourceException(SR.GetString("UnresolvableURI", href), e); } //Check circular inclusion if (_baseURIs.Contains(includeLocation)) @@ -965,13 +976,13 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError("xi:include element cannot be child of xi:include element." - + BaseURI.ToString() - + ", Line " - + li.LineNumber + ", Position " + li.LinePosition); + throw new SyntaxError(SR.GetString("IncludeChildOfIncludeLong", + BaseURI.ToString(), + li.LineNumber, li.LinePosition)); } else - throw new SyntaxError("xi:include element cannot be child of xi:include element."); + throw new SyntaxError(SR.GetString("IncludeChildOfInclude", + BaseURI.ToString())); } if (IsFallbackElement(_reader)) { @@ -982,11 +993,12 @@ if (li != null && li.HasLineInfo()) { //Two xi:fallback - throw new SyntaxError("xi:include element cannot contain more than one xi:fallback element." - + BaseURI.ToString() + ", Line " + li.LineNumber + ", Position " + li.LinePosition); + throw new SyntaxError(SR.GetString("TwoFallbacksLong", + BaseURI.ToString(), + li.LineNumber, li.LinePosition)); } else - throw new SyntaxError("xi:include element cannot contain more than one xi:fallback element."); + throw new SyntaxError(SR.GetString("TwoFallbacks", BaseURI.ToString())); } if (_reader.IsEmptyElement) { @@ -1037,11 +1049,13 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError("xi:include element cannot be child of xi:include element." - + _reader.BaseURI.ToString() + ", Line " + li.LineNumber + ", Position " + li.LinePosition); + throw new SyntaxError(SR.GetString("IncludeChildOfIncludeLong", + _reader.BaseURI.ToString(), + li.LineNumber, li.LinePosition)); } else - throw new SyntaxError("xi:include element cannot be child of xi:include element."); + throw new SyntaxError(SR.GetString("IncludeChildOfInclude", + _reader.BaseURI.ToString())); } if (IsFallbackElement(_reader)) { @@ -1052,11 +1066,12 @@ IXmlLineInfo li = _reader as IXmlLineInfo; if (li != null && li.HasLineInfo()) { - throw new SyntaxError("xi:include element cannot contain more than one xi:fallback element." - + _reader.BaseURI.ToString() + ", Line " + li.LineNumber + ", Position " + li.LinePosition); + throw new SyntaxError(SR.GetString("TwoFallbacksLong", + _reader.BaseURI.ToString(), + li.LineNumber, li.LinePosition)); } else - throw new SyntaxError("xi:include element cannot contain more than one xi:fallback element."); + throw new SyntaxError(SR.GetString("TwoFallbacks", _reader.BaseURI.ToString())); } else { Index: SR.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/SR.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SR.cs 14 Oct 2004 07:26:13 -0000 1.1 +++ SR.cs 14 Oct 2004 13:47:07 -0000 1.2 @@ -49,13 +49,40 @@ } /// <summary></summary> -// public static string InvalidTokenInElementSchemeWhileNumberExpected -// { -// get -// { -// return SR.GetString("InvalidTokenInElementSchemeWhileNumberExpected"); -// } -// } + public static string AttributeOrNamespaceInIncludeLocationError + { + get + { + return SR.GetString("AttributeOrNamespaceInIncludeLocationError"); + } + } + + /// <summary></summary> + public static string IntradocumentReferencesNotSupported + { + get + { + return SR.GetString("IntradocumentReferencesNotSupported"); + } + } + + /// <summary></summary> + public static string CustomXmlResolverError + { + get + { + return SR.GetString("CustomXmlResolverError"); + } + } + + /// <summary></summary> + public static string CustomXmlResolverReturnedNull + { + get + { + return SR.GetString("CustomXmlResolverError"); + } + } } } Index: SR.resx =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/SR.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SR.resx 14 Oct 2004 07:26:13 -0000 1.1 +++ SR.resx 14 Oct 2004 13:47:07 -0000 1.2 @@ -39,7 +39,85 @@ <resheader name="Writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <!-- <data name="InvalidTokenInElementSchemeWhileNumberExpected" type="System.String" mimetype="System.String"> - <value>Syntax error in element() scheme data: Invalid token in ChildSequence, a number was expected.</value> - </data> --> + <data name="NotSupportedEncoding" type="System.String" mimetype="System.String"> + <value>Not supported encoding '{0}'.</value> + </data> + <data name="OutOfMemoryWhileFetchingResource" type="System.String" mimetype="System.String"> + <value>Out of memory error while reading resource '{0}'.</value> + </data> + <data name="IOErrorWhileFetchingResource" type="System.String" mimetype="System.String"> + <value>I/O error while reading resource '{0}'.</value> + </data> + <data name="UnknownParseAttrValue" type="System.String" mimetype="System.String"> + <value>Unknown 'parse' attribute value: '{0}'.</value> + </data> + <data name="UnknownParseAttrValueLong" type="System.String" mimetype="System.String"> + <value>Unknown 'parse' attribute value: '{0}'. In {1}, Line {2}, Position {3}.</value> + </data> + <data name="NonXmlCharacter" type="System.String" mimetype="System.String"> + <value>Included document contains a character not allowed in XML: 0x{0}.</value> + </data> + <data name="CircularInclusion" type="System.String" mimetype="System.String"> + <value>Circular inclusion has been detected, inclusion location: {0}.</value> + </data> + <data name="CircularInclusionLong" type="System.String" mimetype="System.String"> + <value>Circular inclusion has been detected, inclusion location: {0}. In {1}, Line {2}, Position {3}.</value> + </data> + <data name="FatalResourceException" type="System.String" mimetype="System.String"> + <value>Resource error has occured and no fallback has been provided: {0}.</value> + </data> + <data name="AttributeOrNamespaceInIncludeLocationError" type="System.String" mimetype="System.String"> + <value>Include location identifies an attribute or namespace node!</value> + </data> + <data name="FallbackNotChildOfInclude" type="System.String" mimetype="System.String"> + <value>xi:fallback element must be direct child of xi:include element. Location: {0}.</value> + </data> + <data name="FallbackNotChildOfIncludeLong" type="System.String" mimetype="System.String"> + <value>xi:fallback element must be direct child of xi:include element. Location: {0}, Line {1}, Position {2}.</value> + </data> + <data name="URISchemaNotSupported" type="System.String" mimetype="System.String"> + <value>URI schema is not supported: '{0}'.</value> + </data> + <data name="SecurityException" type="System.String" mimetype="System.String"> + <value>Security exception while fetching '{0}'.</value> + </data> + <data name="ResourceError" type="System.String" mimetype="System.String"> + <value>Resource '{0}' cannot be fetched.</value> + </data> + <data name="MissingHrefAndXpointerException" type="System.String" mimetype="System.String"> + <value>'href' or 'xpointer' attributes can't both be omitted on xi:include element. Location: {0}."</value> + </data> + <data name="MissingHrefAndXpointerExceptionLong" type="System.String" mimetype="System.String"> + <value>'href' or 'xpointer' attributes can't both be omitted on xi:include element. Location: {0}, Line {1}, Position {2}.</value> + </data> + <data name="IntradocumentReferencesNotSupported" type="System.String" mimetype="System.String"> + <value>Intra-document references are not supported yet.</value> + </data> + <data name="CustomXmlResolverError" type="System.String" mimetype="System.String"> + <value>An exception has occured during GetEntity call to custom XmlResolver.</value> + </data> + <data name="CustomXmlResolverReturnedNull" type="System.String" mimetype="System.String"> + <value>Custom XmlResolver returned null.</value> + </data> + <data name="CustomXmlResolverReturnedUnsupportedType" type="System.String" mimetype="System.String"> + <value>Custom XmlResolver returned object of an unsupported type '{0}'.</value> + </data> + <data name="InvalidURI" type="System.String" mimetype="System.String"> + <value>Invalid URI '{0}'.</value> + </data> + <data name="UnresolvableURI" type="System.String" mimetype="System.String"> + <value>Unable to resolve URI reference '{0}'.</value> + </data> + <data name="IncludeChildOfInclude" type="System.String" mimetype="System.String"> + <value>xi:include element cannot be child of xi:include element. Location: {0}.</value> + </data> + <data name="IncludeChildOfIncludeLong" type="System.String" mimetype="System.String"> + <value>xi:include element cannot be child of xi:include element. Location: {0}, Line {1}, Position {2}.</value> + </data> + <data name="TwoFallbacks" type="System.String" mimetype="System.String"> + <value>xi:include element cannot contain more than one xi:fallback element. Location: {0}.</value> + </data> + <data name="TwoFallbacksLong" type="System.String" mimetype="System.String"> + <value>xi:include element cannot contain more than one xi:fallback element. Location: {0}, Line {1}, Position {2}.</value> + </data> </root> \ No newline at end of file Index: TextIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/TextIncludingReader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TextIncludingReader.cs 29 Sep 2004 21:26:28 -0000 1.2 +++ TextIncludingReader.cs 14 Oct 2004 13:47:07 -0000 1.3 @@ -225,7 +225,7 @@ enc = Encoding.GetEncoding(_encoding); } catch (Exception e) { - throw new ResourceException("Not supported encoding '" + _encoding + "'", e); + throw new ResourceException(SR.GetString("NotSupportedEncoding", _encoding), e); } reader = new StreamReader(stream, enc); } @@ -238,9 +238,9 @@ throw re; } catch (OutOfMemoryException oome) { //Crazy include - memory is out - what about reading by chunks? - throw new ResourceException("Out of memory while reading resource '" + _href + "'", oome); + throw new ResourceException(SR.GetString("OutOfMemoryWhileFetchingResource", _href), oome); } catch (IOException ioe) { - throw new ResourceException("I/O error while fetching '" + _href + "'", ioe); + throw new ResourceException(SR.GetString("IOErrorWhileFetchingResource", _href), ioe); } _state = ReadState.Interactive; return true; @@ -276,7 +276,7 @@ try { return Encoding.GetEncoding(encValue); } catch (Exception e) { - throw new ResourceException("Not supported encoding '" + encValue + "'", e); + throw new ResourceException(SR.GetString("NotSupportedEncoding", encValue), e); } } else //No encoding in XML declaration - UTF-8 by default |