I need to validate a XML file in Javascript using the MSXML parser.
When I try to do this, I get this error:"Validate failed because a DTD or schema was not specified in the document."
It seems that it can't find the schema xsd file.
Here comes the definiton in the schema head:
"<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">..."
And here comes the xml, which is in a div HTML tag:
<xml id="projetosXML" style="display:
none;"><?xml version="1.0" encoding="ISO-8859-1"?>
<projetos xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Projetos.xsd">..."
This is the Javascript code that tries to validate the XML:
if ('complete' == document.all.projetosXML.readyState){
objProjetosXML = document.all.projetosXML;
var validate = objProjetosXML.validate();
if (validate.errorCode != 0)
alert('Erro ao carregar dados dos projetos: (' + validate.errorCode + ') ' + validate.reason);
objProjetosXML.async = false;
document.all.dataCricao.value = getToday();
updateProjectsPersonSelected();
setWeekDay();
}
I've been working for nights and days trying to figure out what's wrong!
Can anybody help me?
[ March 07, 2003: Message edited by: Fernando Matias Valadao ]
[ March 07, 2003: Message edited by: Fernando Matias Valadao ]