• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error validating XML

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic