<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to validate a xml against schema.<BR>I 
have successfully validated the xml against the schema in XMLSpy. <BR>But when i 
am trying to validate it in my java code using JDOM, it is giving me the 
following error: </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>"org.jdom.input.JDOMParseException: Error on line 
1: cvc-elt.1: Cannot find the declaration of element 'Mensagem'." </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am using the following code: </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SAXBuilder sb = new 
SAXBuilder("org.apache.xerces.parsers.SAXParser");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sb.setValidation(true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sb.setFeature("<A 
href="http://apache.org/xml/features/validation/schema">http://apache.org/xml/features/validation/schema</A>", 
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sb.setProperty("<A 
href="http://apache.org/xml/properties/schema/external-schemaLocation">http://apache.org/xml/properties/schema/external-schemaLocation</A>", 
"<A 
href="http://localhost:8988/gofer/gofer.xsd">http://localhost:8988/gofer/gofer.xsd</A>");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
this.setDocumentoXML( sb.build( new StringReader(valorParam) ) ); </FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>gofer.xsd (Root Element): <BR>================= <BR>&lt;xs:schema 
xmlns:xs="<A 
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>" 
elementFormDefault="qualified" attributeFormDefault="unqualified"&gt; 
<BR>&nbsp;&lt;xs:element name="Mensagem"&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>xml String (Root Element) <BR>================= <BR>&lt;?xml version="1.0" 
encoding="ISO-8859-1" ?&gt;<BR>&nbsp;&lt;Mensagem xmlns:xsi="<A 
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>" 
xsi:noNamespaceSchemaLocation="<A 
href="http://localhost:8988/gofer/gofer.xsd">http://localhost:8988/gofer/gofer.xsd</A>" 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
identificador="L00196b6272223b453ed9844a8815ac7f2f9"&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>I am wondering if I am doing anything wrong. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks </DIV>
<DIV>&nbsp;</DIV>
<DIV>Marcio Nielsen Baptista. <BR></FONT></DIV></BODY></HTML>