XML Parser No Code Found [message #163133] |
Tue, 07 March 2006 13:15  |
Eclipse User |
|
|
|
I am trying to validate an XML string with a schema. I copied a process
that uses the SAXBuilder to peroform this task. I created a new method in
a different class that performs this. I wrote a web service that reads
in the XML file and then calls the method to validate the XML string.
However, with the following code when I try to create an instance of the
class I get a no code found error. If I comment out this code within the
class then I the instance in created without error. I can't figure out
why this code would cause the instance to fail when being created. I get
no flagged errors or warning in the code either. If someone can help
explain I would greatly appreciate.
Thanks,
Ben
SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",
true);
builder.setFeature("http://apache.org/xml/features/validation/schema",
true);
builder.setFeature("http://xml.org/sax/features/validation", true);
builder.setFeature(" http://apache.org/xml/features/validation/schema-full-checki ng",
true);
try
{
builder.build(xml);
}
catch (JDOMException e)
{
returnString = "Document invalid - " + e.getMessage();
}
catch (Exception e)
{
returnString = "Document invalid - " + e.getMessage();
}
return returnString;
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03256 seconds