+2003-08-10 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+ * DTDObjectModel.cs : added XmlResolver related members. Added
+ invalid entity recursion logic. Added encodingdecl check on textdecl.
+ * DTDValidatingReader.cs : It now implements IHasXmlParserContext.
+ * XmlChar.cs : IsPubidChar() should not allow TAB(	).
+ * XmlDocumentType.cs : 1) internal CreateDocumentType() was now changed
+ to receive DTDObjectModel to support other than XmlTextReader.
+ 2) Most of its public member is now based on DTDObjectModel.
+ * XmlDocument.cs : 1) Synchronous change with XmlDocumentType.
+ 2) ReadNode() now considers XmlParserContext's DTDObjectModel for
+ other than XmlTextReader (such as XmlValidatingReader).
+ * XmlNode.cs : code cleanup only.
+ * XmlParserInput.cs : added HasPEBuffer, used to check illegal nesting.
+ * XmlTextReader.cs : 1) Illegal entity reference check logic was moved
+ from ReadContent() to SetEntityReferenceProperties(). 2) Indentation
+ change on ReadEntityReference(). 3) ReadAttribute() now checks
+ reference to external entity reference. 4) Added textdecl encoding
+ check. 5) DTDObjectModel fields are now set correctly. 6) added
+ PERef markup nest check. 7) If PEDecl was not found, it might be WFC
+ violation, not only be VC violation. 8) ReadEntityDecl() now receives
+ its declared entity itself, and this method checks IsInternalSubset.
+ * XmlValidatingReader.cs : 1) Added GetInternalPerserContext().
+ 2) ValidationType.None should be the same as Auto, not DTD (in the
+ future it should keep xml schema's default values).
+
+ Pending Stuff in XmlTextReader which breaks some NUnit tests;
+ 1) SetEntityReferenceProperies() has check for illegal references.
+ 2) ReadAttribute(bool) has similar check for illegal references.
+
2003-08-09 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* DTDAutomata.cs : Fixed (modified or added) TryEndElement() of choice,
//
using System;
using System.Collections;
+using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.Text;
DTDEntityDeclarationCollection entityDecls;
DTDNotationDeclarationCollection notationDecls;
ArrayList validationErrors;
+ XmlResolver resolver;
public DTDObjectModel ()
{
return decl.EntityValue;
}
+ internal XmlResolver Resolver {
+ get { return resolver; }
+ }
+
+ public XmlResolver XmlResolver {
+ set { resolver = value; }
+ }
+
private DTDAutomataFactory factory;
public DTDAutomataFactory Factory {
get { return factory; }
{
private DTDObjectModel root;
public string BaseURI;
+ public int LineNumber;
+ public int LinePosition;
internal void SetRoot (DTDObjectModel root)
{
public string NotationName;
public string LiteralEntityValue;
public bool IsInternalSubset;
+ public StringCollection ReferencingEntities = new StringCollection ();
+ bool scanned;
+ bool recursed;
public string EntityValue {
get {
if (entityValue == null) {
- if (SystemId == null)
+ if (NotationName != null)
+ entityValue = "";
+ else if (SystemId == null)
entityValue = LiteralEntityValue;
else {
// FIXME: should use specified XmlUrlResolver.
- entityValue = ResolveExternalEntity (new XmlUrlResolver ());
+ entityValue = ResolveExternalEntity (Root.Resolver);
}
+ // Check illegal recursion.
+ ScanEntityValue (new StringCollection ());
}
return entityValue;
}
}
+ public void ScanEntityValue (StringCollection refs)
+ {
+ // To modify this code, beware nesting between this and EntityValue.
+ string value = EntityValue;
+
+ if (recursed)
+ throw new XmlException ("Entity recursion was found.");
+ recursed = true;
+
+ if (scanned) {
+ foreach (string referenced in refs)
+ if (this.ReferencingEntities.Contains (referenced))
+ throw new XmlException (String.Format (
+ "Nested entity was found between {0} and {1}",
+ referenced, Name));
+ recursed = false;
+ return;
+ }
+
+ int len = value.Length;
+ int start = 0;
+ for (int i=0; i<len; i++) {
+ switch (value [i]) {
+ case '&':
+ start = i+1;
+ break;
+ case ';':
+ if (start == 0)
+ break;
+ string name = value.Substring (start, i - start);
+ this.ReferencingEntities.Add (name);
+ DTDEntityDeclaration decl = Root.EntityDecls [name];
+ if (decl != null) {
+ refs.Add (Name);
+ decl.ScanEntityValue (refs);
+ foreach (string str in decl.ReferencingEntities)
+ ReferencingEntities.Add (str);
+ refs.Remove (Name);
+ }
+ start = 0;
+ break;
+ }
+ }
+ scanned = true;
+ recursed = false;
+ }
+
private string ResolveExternalEntity (XmlResolver resolver)
{
if (resolver == null)
bool checkTextDecl = true;
while (reader.Peek () != -1) {
- sb.Append (reader.Read ());
+ sb.Append ((char) reader.Read ());
if (checkTextDecl && sb.Length == 6) {
if (sb.ToString () == "<?xml ") {
// Skip Text declaration.
sb.Length = 0;
StringBuilder textdecl = new StringBuilder ();
- while (reader.Peek () == '>' || reader.Peek () == -1)
- textdecl.Append (reader.Read ());
+ while (reader.Peek () != '>' && reader.Peek () != -1)
+ textdecl.Append ((char) reader.Read ());
+ if (textdecl.ToString ().IndexOf ("encoding") < 0)
+ throw new XmlException ("Text declaration must have encoding specification: " + BaseURI);
if (textdecl.ToString ().IndexOf ("standalone") >= 0)
throw new XmlException ("Text declaration cannot have standalone declaration: " + BaseURI);
}
string absPath = absUri.ToString ();
try {
- TextReader tw = new XmlStreamReader (absUri.ToString (), false, resolver, BaseURI);
+ XmlStreamReader tw = new XmlStreamReader (absUri.ToString (), false, resolver, BaseURI);
string s = tw.ReadToEnd ();
if (s.StartsWith ("<?xml")) {
- int end = s.IndexOf (">" + 1);
- if (s.IndexOf ("standal0ne", end) >= 0)
+ int end = s.IndexOf (">") + 1;
+ if (end < 0)
+ throw new XmlException (this as IXmlLineInfo,
+ "Inconsistent text declaration markup.");
+ if (s.IndexOf ("encoding", 0, end) < 0)
+ throw new XmlException (this as IXmlLineInfo,
+ "Text declaration must not omit encoding specification.");
+ if (s.IndexOf ("standalone", 0, end) >= 0)
throw new XmlException (this as IXmlLineInfo,
"Text declaration cannot have standalone declaration.");
resolvedValue = s.Substring (end);
namespace Mono.Xml
{
- public class DTDValidatingReader : XmlReader, IXmlLineInfo
+ public class DTDValidatingReader : XmlReader, IXmlLineInfo, IHasXmlParserContext
{
public DTDValidatingReader (XmlReader reader)
: this (reader, null)
throw new InvalidOperationException ("The current node is not an Entity Reference");
DTDEntityDeclaration entity = DTD != null ? DTD.EntityDecls [reader.Name] as DTDEntityDeclaration : null;
- XmlParserContext ctx = null;
- if (sourceTextReader != null)
- ctx = sourceTextReader.GetInternalParserContext ();
- else if (reader is XmlNodeReader)
- ctx = ((XmlNodeReader) reader).GetInternalParserContext ();
- else if (reader is IHasXmlParserContext)
- ctx = ((IHasXmlParserContext) reader).ParserContext;
-
- if (ctx == null)
- throw new NotSupportedException (
- "Entity resolution from non-XmlTextReader XmlReader could not be supported.");
-
XmlNodeType xmlReaderNodeType =
(currentAttribute != null) ? XmlNodeType.Attribute : XmlNodeType.Element;
if (entity != null && entity.SystemId != null) {
Uri baseUri = entity.BaseURI == null ? null : new Uri (entity.BaseURI);
Stream stream = resolver.GetEntity (resolver.ResolveUri (baseUri, entity.SystemId), null, typeof (Stream)) as Stream;
- nextEntityReader = new XmlTextReader (stream, xmlReaderNodeType, ctx);
+ nextEntityReader = new XmlTextReader (stream, xmlReaderNodeType, ParserContext);
} else {
string replacementText =
(entity != null) ? entity.EntityValue : String.Empty;
- nextEntityReader = new XmlTextReader (replacementText, xmlReaderNodeType, ctx);
+ nextEntityReader = new XmlTextReader (replacementText, xmlReaderNodeType, ParserContext);
}
nextEntityReader.XmlResolver = resolver;
nextEntityReader.MaybeTextDecl = true;
}
}
+ public XmlParserContext ParserContext {
+ get {
+ XmlParserContext ctx = null;
+ if (sourceTextReader != null)
+ ctx = sourceTextReader.GetInternalParserContext ();
+ else if (reader is XmlNodeReader)
+ ctx = ((XmlNodeReader) reader).GetInternalParserContext ();
+ else if (reader is IHasXmlParserContext)
+ ctx = ((IHasXmlParserContext) reader).ParserContext;
+
+ if (ctx == null)
+ throw new NotSupportedException (
+ "Cannot get parser context from specified XmlReader. To support this XmlReader, implement IHasXmlParserContext interface on the reader.");
+
+ return ctx;
+ }
+ }
+
public override string Prefix {
get {
if (currentTextValue != null)
\r
internal static bool IsPubidChar(int ch)\r
{\r
- return IsWhitespace(ch) | ('a' <= ch && ch <= 'z') | ('A' <= ch && ch <= 'Z') | ('0' <= ch && ch <= '9') | "-'()+,./:=?;!*#@$_%".IndexOf((char)ch) >= 0;\r
+ return (IsWhitespace(ch) && ch != '\t') | ('a' <= ch && ch <= 'z') | ('A' <= ch && ch <= 'Z') | ('0' <= ch && ch <= '9') | "-'()+,./:=?;!*#@$_%".IndexOf((char)ch) >= 0;\r
}\r
\r
internal static bool IsPubid (string str)\r
return new XmlDocumentType (name, publicId, systemId, internalSubset, this);
}
- private XmlDocumentType CreateDocumentType (XmlTextReader reader)
+ private XmlDocumentType CreateDocumentType (DTDObjectModel dtd)
{
- return new XmlDocumentType (reader, this);
+ return new XmlDocumentType (dtd, this);
}
public XmlElement CreateElement (string name)
break;
case XmlNodeType.DocumentType:
- // hack ;-)
+ if(currentNode != null)
+ throw new XmlException (reader as IXmlLineInfo, "XmlDocumentType at invalid position.");
+
+ DTDObjectModel dtd = null;
XmlTextReader xtReader = reader as XmlTextReader;
- if(xtReader == null)
- newNode = CreateDocumentType (reader.Name, reader ["PUBLIC"], reader ["SYSTEM"], reader.Value);
+ if (xtReader != null)
+ dtd = xtReader.DTD;
+ XmlNodeReader xnReader = reader as XmlNodeReader;
+ if (xnReader != null)
+ dtd = xnReader.GetInternalParserContext ().Dtd;
+ XmlValidatingReader xvReader = reader as XmlValidatingReader;
+ if (xvReader != null)
+ dtd = xvReader.GetInternalParserContext ().Dtd;
+ IHasXmlParserContext ctxReader = reader as IHasXmlParserContext;
+ if (ctxReader != null)
+ dtd = ctxReader.ParserContext.Dtd;
+
+ if (dtd != null)
+ newNode = CreateDocumentType (dtd);
else
- newNode = CreateDocumentType (xtReader);
+ newNode = CreateDocumentType (reader.Name, reader ["PUBLIC"], reader ["SYSTEM"], reader.Value);
- if(currentNode != null)
- throw new XmlException (reader as IXmlLineInfo, "XmlDocumentType at invalid position.");
break;
case XmlNodeType.EntityReference:
public class XmlDocumentType : XmlLinkedNode\r
{\r
// Fields\r
- string name; // name of the document type\r
- string publicId; // public identifier on the DOCTYPE\r
- string systemId; // system identifier on the DOCTYPE\r
- string internalSubset; // value of the DTD internal subset\r
+// string name; // name of the document type\r
+// string publicId; // public identifier on the DOCTYPE\r
+// string systemId; // system identifier on the DOCTYPE\r
+// string internalSubset; // value of the DTD internal subset\r
internal XmlNamedNodeMap entities;\r
internal XmlNamedNodeMap notations;\r
DTDObjectModel dtd;\r
XmlDocument doc)\r
: base (doc)\r
{\r
- this.name = name;\r
- this.publicId = publicId;\r
- this.systemId = systemId;\r
- this.internalSubset = internalSubset;\r
-\r
XmlTextReader xtr = new XmlTextReader (BaseURI, new StringReader (""), doc.NameTable);\r
xtr.XmlResolver = doc.Resolver;\r
xtr.GenerateDTDObjectModel (name, publicId, systemId, internalSubset);\r
ImportFromDTD ();\r
}\r
\r
- internal XmlDocumentType (XmlTextReader reader, XmlDocument doc)\r
+ internal XmlDocumentType (DTDObjectModel dtd, XmlDocument doc)\r
: base (doc)\r
{\r
- this.name = reader.Name;\r
- this.publicId = reader ["PUBLIC"];\r
- this.systemId = reader ["SYSTEM"];\r
- this.internalSubset = reader.Value;\r
- this.dtd = reader.DTD;\r
-\r
+ this.dtd = dtd;\r
ImportFromDTD ();\r
}\r
\r
\r
public string InternalSubset\r
{\r
- get { return internalSubset; }\r
+ get { return dtd.InternalSubset; }\r
}\r
\r
public override bool IsReadOnly\r
\r
public override string LocalName\r
{\r
- get { return name; }\r
+ get { return dtd.Name; }\r
}\r
\r
public override string Name\r
{\r
- get { return name; }\r
+ get { return dtd.Name; }\r
}\r
\r
public override XmlNodeType NodeType\r
\r
public string PublicId\r
{\r
- get { return publicId; }\r
+ get { return dtd.PublicId; }\r
}\r
\r
public string SystemId\r
{\r
- get { return systemId; }\r
+ get { return dtd.SystemId; }\r
}\r
\r
// Methods\r
public override XmlNode CloneNode (bool deep)\r
{\r
// deep is ignored\r
- return new XmlDocumentType (name, publicId, systemId,\r
- internalSubset, OwnerDocument);\r
+// return new XmlDocumentType (Name, PublicId, SystemId,\r
+// InternalSubset, OwnerDocument);\r
+ return new XmlDocumentType (dtd, OwnerDocument);\r
}\r
\r
public override void WriteContentTo (XmlWriter w)\r
\r
public override void WriteTo (XmlWriter w)\r
{\r
- w.WriteDocType (name, publicId, systemId, internalSubset);\r
+ w.WriteDocType (Name, PublicId, SystemId, InternalSubset);\r
}\r
}\r
}\r
public abstract XmlNode CloneNode (bool deep);
- [MonoTODO]
public XPathNavigator CreateNavigator ()
{
XmlDocument document = this.NodeType == XmlNodeType.Document ?
return InsertBefore (newChild, argNode);
}
- [MonoTODO("If inserted node is entity reference, then check conforming entity. Wait for DTD implementation.")]
public virtual XmlNode InsertBefore (XmlNode newChild, XmlNode refChild)
{
XmlDocument ownerDoc = (NodeType == XmlNodeType.Document) ? (XmlDocument)this : OwnerDocument;
return SelectNodes (xpath, null);
}
- [MonoTODO]
+ [MonoTODO ("return nodes in document order")]
public XmlNodeList SelectNodes (string xpath, XmlNamespaceManager nsmgr)
{
XPathNavigator nav = CreateNavigator ();
return ((XmlDocumentNavigator) iter.Current).Node;
}
-// internal void SetParentNode (XmlNode parent)
-// {
-// parentNode = parent;
-// }
-
[MonoTODO]
public virtual bool Supports (string feature, string version)
{
get { return this.currentMarkup; }
}
+ private char [] wsChars = new char [] {' ', '\r', '\n', '\t'};
+ public bool HasPEBuffer {
+ get {
+ if (peBuffer.Length == 0)
+ return false;
+ else if (peBuffer.ToString ().Trim (wsChars).Length == 0)
+ return false;
+ else
+ return true;
+ }
+ }
+
public int LineNumber {
get { return line; }
}
using System;
using System.Collections;
+using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Xml.Schema;
popScope = false;
}
- if (returnEntityReference) {
+ if (returnEntityReference)
SetEntityReferenceProperties ();
- if (DTD == null)
- throw new XmlException (this as IXmlLineInfo,
- "Entity reference is not allowed without document type declaration.");
- else if((!DTD.InternalSubsetHasPEReference ||
- isStandalone || resolver == null) && DTD.EntityDecls [name] == null)
- throw new XmlException (this as IXmlLineInfo,
- "Required entity declaration for '" + name + "' was not found.");
- } else {
+ else {
switch (PeekChar ()) {
case '<':
ReadChar ();
private void SetEntityReferenceProperties ()
{
+/*
+ if (resolver != null) {
+ if (DTD == null)
+ throw new XmlException (this as IXmlLineInfo,
+ "Entity reference is not allowed without document type declaration.");
+ else if((!DTD.InternalSubsetHasPEReference || isStandalone) &&
+ DTD.EntityDecls [entityReferenceName] == null)
+ throw new XmlException (this as IXmlLineInfo,
+ "Required entity declaration for '" + entityReferenceName + "' was not found.");
+ string dummy = DTD.EntityDecls [entityReferenceName].EntityValue;
+ }
+*/
SetProperties (
XmlNodeType.EntityReference, // nodeType
entityReferenceName, // name
throw new XmlException (this as IXmlLineInfo,
"Invalid entity reference name was found.");
- char predefined = XmlChar.GetPredefinedEntity (name);
- if (predefined != 0)
- AppendValueChar (predefined);
- else {
- if (ignoreEntityReferences) {
- AppendValueChar ('&');
-
- foreach (char ch2 in name) {
- AppendValueChar (ch2);
- }
+ char predefined = XmlChar.GetPredefinedEntity (name);
+ if (predefined != 0)
+ AppendValueChar (predefined);
+ else {
+ if (ignoreEntityReferences) {
+ AppendValueChar ('&');
- AppendValueChar (';');
- } else {
- returnEntityReference = true;
- entityReferenceName = name;
+ foreach (char ch2 in name) {
+ AppendValueChar (ch2);
}
+
+ AppendValueChar (';');
+ } else {
+ returnEntityReference = true;
+ entityReferenceName = name;
}
+ }
}
// The reader is positioned on the first character of
if (XmlChar.GetPredefinedEntity (entName) == 0) {
DTDEntityDeclaration entDecl =
DTD == null ? null : DTD.EntityDecls [entName];
- // In this point, XML 1.0 spec is tricky. Its WFC constraints
- // allow non-declared entity, while prohibiting external entity reference.
- if (entDecl == null || !entDecl.IsInternalSubset)
+ if (entDecl == null || entDecl.SystemId != null)
throw new XmlException (this as IXmlLineInfo,
"Reference to external entities is not allowed in attribute value.");
}
message = "Version 1.0 declaration is required in Text Declaration.";
currentCheck = 1;
}
- if (orderedAttributes.Count > currentCheck && orderedAttributes [currentCheck] as string != "encoding")
- message = "Invalid Text Declaration markup was found.";
+ if (orderedAttributes.Count <= currentCheck || orderedAttributes [currentCheck] as string != "encoding")
+ message = "Invalid Text Declaration markup was found. encoding specification is required.";
}
if (message != null)
throw new XmlException (this as IXmlLineInfo, message);
currentState = XmlNodeType.DocumentType;
string doctypeName = null;
- string publicId = String.Empty;
- string systemId = String.Empty;
+ string publicId = null;
+ string systemId = null;
int intSubsetStartLine = 0;
int intSubsetStartColumn = 0;
parserContext.Dtd = new DTDObjectModel (); // merges both internal and external subsets in the meantime,
DTD.BaseURI = BaseURI;
DTD.Name = name;
+ DTD.PublicId = publicId;
+ DTD.SystemId = systemId;
+ DTD.InternalSubset = internalSubset;
+ DTD.XmlResolver = resolver;
int originalParserDepth = parserInputStack.Count;
if (internalSubset != null && internalSubset.Length > 0) {
XmlParserInput original = currentInput;
} while (nodeType != XmlNodeType.None || parserInputStack.Count > originalParserDepth + 1);
PopParserInput ();
}
- // TODO: Check entity nesting
return DTD;
}
// It affects on entity references' well-formedness
if (this.parserInputStack.Count == 0)
DTD.InternalSubsetHasPEReference = true;
- TryExpandPERef ();
+ ReadChar ();
+ string peName = ReadName ();
+ Expect (';');
+ currentInput.InsertParameterEntityBuffer (GetPEValue (peName));
+ int currentLine = currentInput.LineNumber;
+ int currentColumn = currentInput.LinePosition;
+ while (currentInput.HasPEBuffer)
+ CompileDTDSubset ();
+ if (currentInput.LineNumber != currentLine ||
+ currentInput.LinePosition != currentColumn)
+ throw new XmlException (this as IXmlLineInfo,
+ "Incorrectly nested parameter entity.");
break;
case '<':
ReadChar ();
TryExpandPERef ();
SkipWhitespace ();
if (XmlChar.IsNameChar (PeekChar ()))
- ReadParameterEntityDecl ();
+ ReadParameterEntityDecl ();
else
throw new XmlException (this as IXmlLineInfo,"expected name character");
}
this.parameterEntities [peName] as DTDParameterEntityDeclaration;
if (peDecl != null)
return peDecl.Value;
- DTD.AddError (new XmlSchemaException (
- "Parameter entity " + peName + " not found.", null));
+ // See XML 1.0 section 4.1 for both WFC and VC.
+ if ((DTD.SystemId == null && !DTD.InternalSubsetHasPEReference) || this.isStandalone)
+ throw new XmlException (this as IXmlLineInfo,
+ "Parameter entity " + peName + " not found.");
+ DTD.AddError (new XmlSchemaException (
+ "Parameter entity " + peName + " not found.", null));
return "";
}
}
else {
// literal entity
- decl.LiteralEntityValue = ReadEntityValueDecl ();
+ ReadEntityValueDecl (decl);
}
SkipWhitespace ();
// This expanding is only allowed as a non-validating parser.
return decl;
}
- private string ReadEntityValueDecl ()
+ private void ReadEntityValueDecl (DTDEntityDeclaration decl)
{
SkipWhitespace ();
// quotation char will be finally removed on unescaping
ReadChar ();
string name = ReadName ();
Expect (';');
+ if (decl.IsInternalSubset)
+ throw new XmlException (this as IXmlLineInfo,
+ "Parameter entity is not allowed in internal subset entity '" + name + "'");
valueBuffer.Append (GetPEValue (name));
- continue;
break;
case -1:
throw new XmlException ("unexpected end of stream.");
ClearValueBuffer ();
Expect (quoteChar);
- return value;
+ decl.LiteralEntityValue = value;
}
private DTDAttListDeclaration ReadAttListDecl ()
case 'O':
Expect ("OTATION");
def.Datatype = XmlSchemaDatatype.FromName ("NOTATION");
- SkipWhitespace ();
+ if (!SkipWhitespace ())
+ throw new XmlException (this as IXmlLineInfo,
+ "Whitespace is required between name and content in DTD attribute definition.");
Expect ('(');
SkipWhitespace ();
def.EnumeratedNotations.Add (ReadName ()); // notation name
XmlResolver resolver;
ValidationType validationType;
XmlSchemaCollection schemas;
+ DTDValidatingReader dtdReader;
#endregion // Fields
return validatingReader.GetAttribute (localName, namespaceName);
}
+ internal XmlParserContext GetInternalParserContext ()
+ {
+ return dtdReader != null ?
+ dtdReader.ParserContext : null;
+ }
+
bool IXmlLineInfo.HasLineInfo ()
{
IXmlLineInfo info = validatingReader as IXmlLineInfo;
if (ReadState == ReadState.Initial) {
switch (ValidationType) {
case ValidationType.Auto:
+ case ValidationType.None:
if (schemas.Count > 0)
goto case ValidationType.Schema;
else
goto case ValidationType.DTD;
- case ValidationType.None:
- validatingReader = // new XmlSchemaValidatingReader (
- new DTDValidatingReader (sourceReader, this);
- break;
case ValidationType.DTD:
- validatingReader = new DTDValidatingReader (sourceReader, this);
+ validatingReader = dtdReader = new DTDValidatingReader (sourceReader, this);
break;
case ValidationType.Schema:
-// validatingReader = new XmlSchemaValidatingReader (sourceReader, this);
+// dtdReader = new DTDValidatingReader (sourceReader, this);
+// validatingReader = new XmlSchemaValidatingReader (dtdReader, this);
// break;
case ValidationType.XDR:
throw new NotImplementedException ();