lilu
August 17th, 2003, 07:04 PM
Hi ,
I want validate a XML file using a schema in my ASP page.
I'm doing something like this:
------------------------------------------------------------------------------------Dim MyDom
set MyDom = Server.CreateObject("MSXML2.DOMDocument")
MyDom.load(server.MapPath("c:\temp\book.xml"))
if (MyDom.validate() = 0)
Response.write("valid xml document")
else
Response.write("invalid xml document")
end if
------------------------------------------------------------------------------------
Here validate() function always retruns error code :0xC00CE224. As per MSDN this means "Validate failed because a DTD or schema was not specified in the document."
But I have linked the schema file in my xml(book.xml) file like this :
<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="c:\temp\book.xsd">
so it should have got that schema file. Here both .xml and .xsd file are in c:\temp folder.
Please let me know if I'm doing anything wrong here.
Lilu.
I want validate a XML file using a schema in my ASP page.
I'm doing something like this:
------------------------------------------------------------------------------------Dim MyDom
set MyDom = Server.CreateObject("MSXML2.DOMDocument")
MyDom.load(server.MapPath("c:\temp\book.xml"))
if (MyDom.validate() = 0)
Response.write("valid xml document")
else
Response.write("invalid xml document")
end if
------------------------------------------------------------------------------------
Here validate() function always retruns error code :0xC00CE224. As per MSDN this means "Validate failed because a DTD or schema was not specified in the document."
But I have linked the schema file in my xml(book.xml) file like this :
<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="c:\temp\book.xsd">
so it should have got that schema file. Here both .xml and .xsd file are in c:\temp folder.
Please let me know if I'm doing anything wrong here.
Lilu.