Hi,
I have the following code to validate an xml document with an xml schema(please refer below). It's giving an error shown below.
Please help!
Thanks,
Tina
Error
--------------------------------------------
57 cannot find symbol symbol : method setFeature(java.lang.String,boolean)
location: class org.jdom.input.SAXBuilder
builder.setFeature("http://xml.org/sax/features/validation", true);
58: cannot find symbol symbol : method setFeature(java.lang.String,boolean)
location: class org.jdom.input.SAXBuilder
builder.setFeature("http://apache.org/xml/features/validation/schema", true);
59: cannot find symbol symbol : method setFeature(java.lang.String,boolean)
location: class org.jdom.input.SAXBuilder
builder.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
60: cannot find symbol symbol : method setProperty(java.lang.String,java.lang.String)
location: class org.jdom.input.SAXBuilder
builder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",xsdFile);
java file
--------------------
import org.jdom.* ;
import org.jdom.input.*;
import org.jdom.output.* ;
import org.jdom.xpath.*;
import java.util.regex.*;
import java.util.*;
import java.io.*;
public wc
{
SAXBuilder builder = new SAXBuilder();
builder.setFeature("http://xml.org/sax/features/validation", true);
builder.setFeature("http://apache.org/xml/features/validation/schema", true);
builder.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
builder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",xsdFile);
Document
doc = builder.build(new File("C:\\myJavaStuff\\ISE\\programming\\ise_3_1.xml"));
}
---------------------------------------------------------
xml file
-----------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Schedules xmlns:ns1="http://mie.edu/niem/structures/2.0" xmlns:ns2="http://iljiseda.dlsa.com" xmlns:ns3="http://mie.edu/niem/niem-core/2.0" xmlns:ns4="http://mie.edu/niem/appinfo/2.0">
<ns2:Schedule ReasonCode="M">
<ns2
rganizationAgencyName>AB</ns2
rganizationAgencyName>
<ns3
rganizationBranchName>Newport</ns3
rganizationBranchName>
<ns3:IdentificationID>bfletcher</ns3:IdentificationID>
<ns3 :p ersonGivenName>Ben</ns3 :p ersonGivenName>
<ns3 :p ersonMiddleName>Anton</ns3 :p ersonMiddleName>
<ns3 :p ersonSurName>Fletcher</ns3 :p ersonSurName>
<ns2:StartDate>2008-05-26-07:00</ns2:StartDate>
<ns2:EndDate>2008-06-01-07:00</ns2:EndDate>
</ns2:Schedule>
<ns2:Schedule ReasonCode="T">
<ns2
rganizationAgencyName>AB</ns2
rganizationAgencyName>
<ns3
rganizationBranchName>Newport Beach</ns3
rganizationBranchName>
<ns3:IdentificationID>opearson</ns3:IdentificationID>
<ns3 :p ersonGivenName>Oscar</ns3 :p ersonGivenName>
<ns3 :p ersonMiddleName></ns3 :p ersonMiddleName>
<ns3 :p ersonSurName>Pearson</ns3 :p ersonSurName>
<ns2:StartDate>2008-06-02-07:00</ns2:StartDate>
<ns2:EndDate>2008-06-08-07:00</ns2:EndDate>
</ns2:Schedule>
</ns2:Schedules>
[ June 04, 2008: Message edited by: Christina Cardino ]