Hi,
I am using an xml schema (Schema1.xsd) which refers to two other
Schemas as follows.
<xsd:schema xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:plcm-s="http://www.mycompany.c om/plcm"
targetNamespace ="http://www.mycompany.c om/plcm"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<xsd:include schemaLocation= "Schema2.xs d"/>
<xsd:include schemaLocation= "Schema3.xs d"/>
All three schemas are stored in a Database as strings (SQL Server
2000).
Now I am trying to load the Schema1 from datbase by using the following
code.
public XmlSchema GetSchema()
{
XmlSchema PLCMSchema = null;
String schema1StringFr omDatabase=//Get Schema1 from
Database
String schema2StringFr omDatabase=//Get Schema2 from
Database
String schema3StringFr omDatabase=//Get Schema3 from
Database
try
{
TextReader schemaTextReade r = new
StringReader(sc hema1StringFrom Database) as TextReader;
XmlTextReader schemaXmlReader = new
XmlTextReader(s chemaTextReader );
XmlSchema schemaPLCM = XmlSchema.Read( schemaXmlReader ,
new ValidationEvent Handler(schemaS et_ValidationEv entHandler));
XmlSchemaSet schemaset = new XmlSchemaSet();
schemaset.Valid ationEventHandl er += new
ValidationEvent Handler(schemaS et_ValidationEv entHandler);
schemaset.Add(s chemaPLCM);
schemaset.Compi le();
foreach (XmlSchema schema in schemaset.Schem as())
{
PLCMSchema = schema;
}
}
catch (Exception exception)
{
System.Windows. Forms.MessageBo x.Show("Error in
PLCMWorkbenchSh ared.GetSchema( )" + System.Environm ent.NewLine +
exception.Messa ge);
}
return PLCMSchema;
}
But the SchemaSet_Valid ationEventHandl er Returns the error "Cannot
resolve the schemaLocation attribute".
Is there any way I can load the Schema1 from Database without errors
(the other two schemas are also in database)?
Any help is greatly appreciated.
Thanks,
Ramesh