• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Error validating XML

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!