bool resolverSpecified;
ValidationType validationType;
// for 2.0: Now it is obsolete. It is allocated only when it is required
- XmlSchemaSet schemas;
+ XmlSchemaCollection schemas;
DTDValidatingReader dtdReader;
IHasXmlSchemaInfo schemaInfo;
StringBuilder storedCharacters;
get { return validatingReader == null ? sourceReader.BaseURI : validatingReader.BaseURI; }
}
+#if NET_2_0
+ public override bool CanReadBinaryContent {
+ get { return true; }
+ }
+#endif
+
// This property for this class always return true.
public override bool CanResolveEntity {
get { return true; }
public XmlSchemaCollection Schemas {
get {
if (schemas == null)
- schemas = new XmlSchemaSet ();
- return schemas.SchemaCollection;
+ schemas = new XmlSchemaCollection (NameTable);
+ return schemas;
}
}
- internal void SetSchemas (XmlSchemaSet schemas)
- {
- this.schemas = schemas;
- }
-
public object SchemaType {
get { return schemaInfo.SchemaType; }
}
}
#endif
- [MonoTODO ("We decided not to support XDR schema that spec is obsolete.")]
+ [MonoTODO]
+ // We decided not to support XDR schema; it is obsolete.
public ValidationType ValidationType {
get { return validationType; }
set {
}
XmlParserContext IHasXmlParserContext.ParserContext {
- get { return dtdReader != null ? dtdReader.ParserContext : null; }
+ get {
+ if (dtdReader != null)
+ return dtdReader.ParserContext;
+ IHasXmlParserContext i = sourceReader as IHasXmlParserContext;
+ return i != null ? i.ParserContext : null;
+ }
}
#if NET_2_0
return validatingReader.MoveToNextAttribute ();
}
- [MonoTODO ("We decided not to support XDR schema that spec is obsolete.")]
+ [MonoTODO]
+ // We decided not to support XDR schema; it is obsolete.
public override bool Read ()
{
- if (ReadState == ReadState.Initial) {
+ if (validatingReader == null) {
switch (ValidationType) {
case ValidationType.Auto:
case ValidationType.None:
return validatingReader.ReadAttributeValue ();
}
-#if NET_1_0
- // LAMESPEC: MS.NET 1.0 has critical bug here.
- // After calling these methods, validation does not work anymore!
- public override string ReadInnerXml ()
- {
- if (validatingReader == null)
- return "";
- return validatingReader.ReadInnerXml ();
- }
-
- public override string ReadOuterXml ()
- {
- if (validatingReader == null)
- return "";
- return validatingReader.ReadOuterXml ();
- }
-#endif
-
-#if NET_1_0
- public override string ReadString ()
- {
- return base.ReadStringInternal ();
- }
-#else
public override string ReadString ()
{
return base.ReadString ();
}
-#endif
public object ReadTypedValue ()
{
if (dtdReader == null)
return null;
XmlSchemaDatatype dt = schemaInfo.SchemaType as XmlSchemaDatatype;
+ if (dt == null) {
+ XmlSchemaType st = schemaInfo.SchemaType as XmlSchemaType;
+ if (st != null)
+ dt = st.Datatype;
+ }
if (dt == null)
return null;
switch (NodeType) {
do {
Read ();
switch (NodeType) {
+ case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
case XmlNodeType.Text:
case XmlNodeType.CDATA:
}
#if NET_2_0
- [MonoTODO ("Check how expanded entity is handled here.")]
+ [MonoTODO] // FIXME: Check how expanded entity is handled here.
public override int ReadContentAsBase64 (byte [] buffer, int offset, int length)
{
if (validatingReader != null)
return sourceReader.ReadContentAsBase64 (buffer, offset, length);
}
- [MonoTODO ("Check how expanded entity is handled here.")]
+ [MonoTODO] // FIXME: Check how expanded entity is handled here.
public override int ReadContentAsBinHex (byte [] buffer, int offset, int length)
{
if (validatingReader != null)
return sourceReader.ReadContentAsBinHex (buffer, offset, length);
}
- [MonoTODO ("Check how expanded entity is handled here.")]
+ [MonoTODO] // FIXME: Check how expanded entity is handled here.
public override int ReadElementContentAsBase64 (byte [] buffer, int offset, int length)
{
if (validatingReader != null)
return sourceReader.ReadElementContentAsBase64 (buffer, offset, length);
}
- [MonoTODO ("Check how expanded entity is handled here.")]
+ [MonoTODO] // FIXME: Check how expanded entity is handled here.
public override int ReadElementContentAsBinHex (byte [] buffer, int offset, int length)
{
if (validatingReader != null)