commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Herscu <>
Subject [jelly] Still have schema validation problems
Date Tue, 12 Jul 2005 13:21:01 GMT
Hi all (especially Dion),

I have found a validation example here:

Based on that example I tried this:

  1 <validate:verifier
  2   var="verifier"
  3   uri="myschemapath/foo.xsd" />

  4 <core:catch var="exception">
  5   <validate:assertValid var="validFlag" verifier="${verifier}">
  6     <foo
  7       xsi:schemaLocation="foo_ns myschemapath/foo.xsd"
  8       xmlns="foo_ns"
  9       xmlns:base="base_ns"
10       xmlns:xsi="">
11       <a>blah</a>
12       <base:a>trah</base:a>
13     </foo>
14   </validate:assertValid>
15 </core:catch>

16 <echo>Valid: ${validFlag}</echo>
17 <echo>Exception: ${exception}</echo>

My problems are:
1) Line #7, although valid XML, triggers this exception:
<validate:assertValid> The XML is not valid according to the schema: 
error : line: -1 column: -1 message: unexpected attribute 
After deleting line #7 the validation succeeds.

2) Because of the previous problem I cannot use <core:include>, to load 
that document. (Or, should I use something else?)

3) The foo.xsd schema imports a base.xsd schema. While using a 
standalone schema validator (like MS-XML) the import path is resolved 
relatively to myschemapath/. While using the above script, imports are 
resolved relatively to the program's launch path -- so the imported 
schemas are not found.
After changing the paths of the imported schema to be relative to the 
launch path the validation succeeds.

Please help!!!!!

...and thanks for your time,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message