| Article: |
XML Document Validation with an XML Schema | |
| Subject: | I only get Errors :-/ | |
| Date: | 2005-03-25 04:47:37 | |
| From: | Jonas123 | |
|
Hi,
|
||
Showing messages 1 through 10 of 10.
-
I only get Errors :-/
2005-03-25 06:30:09 Deepak Vohra | [View]
-
I only get Errors :-/
2005-03-25 06:17:36 Deepak Vohra | [View]
Tested the SchemaValidator.java program with the Xerces 2.6.2. The xml document gets validated with the schema.
Have you addedxerces-2_6_2/xercesImpl.jarandxml-apis.jarthe Classpath?
-
I only get Errors :-/
2005-03-25 10:27:31 Jonas123 [View]
Hi,
>Have you added xerces-2_6_2/xercesImpl.jar and xml-apis.jar the Classpath?
Maybe that is the problem. The missing class "org.apache.xerces.parsers.SAXParser" is inside xercesImpl.jar.
I use the document validation inside a plugin for a java program called "poseidon" (http://www.gentleware.com). The plugin is a .jar-file that is loaded by poseidon. The plugin jar-file uses some jar's from poseidon, they are inside poseidon program-directory/lib. I tried to copy xercesImpl.jar to poseidon lib-directory, I also tried to include it into my plugin jar-file - but that doesn't help. I am not sure if there is another classpath i have to use and where to find it (I use win XP and JRE 1.4.2).
Maybe you have an idea? -
I only get Errors :-/
2006-11-21 05:10:08 srivas2 [View]
I know that this happened a long time ago but could you tell me how you solved this problem? because i have a similar one using poseidon. -
I only get Errors :-/
2005-03-25 10:38:35 Deepak Vohra | [View]
BTW, which plugin is used to run a java application? -
I only get Errors :-/
2005-03-25 10:48:58 Deepak Vohra | [View]
Add the xerces jar files to the System CLASSPATH. -
Not able to get it to work :(
2005-04-20 00:19:36 java_kid [View]
Inspite of my following all the given steps,
it is trying to validate the file from a DTD and gives me the following :
Parsing error: Document root element "catalog", must match DOCTYPE root "null".
Parsing error: Document is invalid: no grammar found.
Parsing completed with errors
Any idea what the problem could be??
-
Not able to get it to work :(
2005-04-20 14:10:39 Deepak Vohra | [View]
Set the schema validation and schema validation full-checking features.
parser.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
true);
Because the schema validation is not set the parser parses with a DTD which may not be specified.
-
Not able to get it to work :(
2005-04-20 14:09:52 Deepak Vohra | [View]
Set the schema validation and schema validation full-checking features.
[code]parser.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
true); [/code]
Because the schema validation is not set the parser parses with a DTD which may not be specified.
-
Not able to get it to work :(
2005-04-20 04:44:13 Deepak Vohra | [View]
For which parser do you get the errors?
Xerces or JAXP?



To validate with the JAXP parser compile the JAXPValidator.java program.
Add the jar files specified in the Preliminary Setup section to the Classpath.