Browse Source

Now using XmlSchemaSet.Compile() to compile schemas instead of XmlSchema.Compile() which is obsolete.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5079 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
1f5505dbf3
  1. 13
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemaCompletionData.cs
  2. 5
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

13
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemaCompletionData.cs

@ -398,9 +398,14 @@ namespace ICSharpCode.XmlEditor @@ -398,9 +398,14 @@ namespace ICSharpCode.XmlEditor
{
try {
schema = XmlSchema.Read(reader, new ValidationEventHandler(SchemaValidation));
schema.Compile(new ValidationEventHandler(SchemaValidation));
namespaceUri = schema.TargetNamespace;
if (schema != null) {
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.ValidationEventHandler += SchemaValidation;
schemaSet.Add(schema);
schemaSet.Compile();
namespaceUri = schema.TargetNamespace;
}
} finally {
reader.Close();
}
@ -1092,7 +1097,7 @@ namespace ICSharpCode.XmlEditor @@ -1092,7 +1097,7 @@ namespace ICSharpCode.XmlEditor
XmlSchemaSimpleType simpleType = attribute.AttributeSchemaType as XmlSchemaSimpleType;
if (simpleType != null) {
if (simpleType.Name == "boolean") {
if (simpleType.Datatype.TypeCode == XmlTypeCode.Boolean) {
data.AddRange(GetBooleanAttributeValueCompletionData());
} else {
data.AddRange(GetAttributeValueCompletionData(simpleType));

5
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

@ -592,7 +592,10 @@ namespace ICSharpCode.XmlEditor @@ -592,7 +592,10 @@ namespace ICSharpCode.XmlEditor
try {
XmlSchema schema = XmlSchema.Read(xmlReader, new ValidationEventHandler(SchemaValidation));
if (schema != null) {
schema.Compile(new ValidationEventHandler(SchemaValidation));
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add(schema);
schemaSet.ValidationEventHandler += SchemaValidation;
schemaSet.Compile();
}
} catch (XmlSchemaException ex) {
DisplayValidationError(File.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1);

Loading…
Cancel
Save