We have an xml file with a reference to the xsd.
In the VB code we ask for the xml file, which we want to load into a dataset at a later stage. But to validate the xml file against the xsd, it seems that I need to specify the location of the xsd in the VB code.
Why can't the xml methods pick up the location from the reference in the xml file?
Here is the code:
Dim MyXmlDataDocument As XmlDataDocument
Dim MyValidationEventHandler As New ValidationEventHandler(AddressOf MyValidator)
MyXmlDataDocument = New XmlDataDocument
MyXmlDataDocument.Load(ImportedFileNameAndPath)
MyXmlDataDocument.Validate(MyValidationEventHandler)
MyDataSet = MyXmlDataDocument.DataSet
...
End Sub
Private Sub MyValidator( ...
...
End Sub
What am I doing wrong?
Any help would be appreciated
John
In the VB code we ask for the xml file, which we want to load into a dataset at a later stage. But to validate the xml file against the xsd, it seems that I need to specify the location of the xsd in the VB code.
Why can't the xml methods pick up the location from the reference in the xml file?
Here is the code:
Dim MyXmlDataDocument As XmlDataDocument
Dim MyValidationEventHandler As New ValidationEventHandler(AddressOf MyValidator)
MyXmlDataDocument = New XmlDataDocument
MyXmlDataDocument.Load(ImportedFileNameAndPath)
MyXmlDataDocument.Validate(MyValidationEventHandler)
MyDataSet = MyXmlDataDocument.DataSet
...
End Sub
Private Sub MyValidator( ...
...
End Sub
What am I doing wrong?
Any help would be appreciated
John