Hi Graham,

That's a very interesting approach. I will definitely try to do it that way.
And it's way better than what I have to the moment (calling a batch file that 
does the saxon validation call).

Thanks,
Roman


Mag. (FH) Roman Huditsch
 Teamleader XSLT-Development 

Tel.: +43 (1) 534 52 - 1514 
Fax: +43 (1) 534 52 - 146 
Mobil: +43 (0)664 - 965 77 55 
roman.hudit...@lexisnexis.at

LexisNexis Verlag ARD Orac GmbH & Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/
 
-----Ursprüngliche Nachricht-----

Von: Heath, Graham [mailto:graham.he...@ts.fujitsu.com] 
Gesendet: Montag, 10. Mai 2010 11:19
An: user@ant.apache.org
Cc: Michael Kay
Betreff: using <xmlvalidate> task with XML Schema 1.1 and Saxon

Greetings readers,

just to add my take on this..

I use ant extensively and with saxon too. My first attempts used the ant <xlst> 
task, but that fell over when my stylesheets needed to use xslt2.0.
So I switched to <saxon-xslt>, except that then I could not switch on 
line-numbers and tracing. After a discussion on the Saxon list Mike Kay updated 
Saxon so that  the remaining gotchas from the <xslt> task were covered. This 
rendered the <saxon-xslt> task as deprecated. So I have now switched back to 
the <xslt> task. Whereupon I also found validation did not work. My validation 
task calls java direct.. Just at the moment it is not a satisfactory solution 
as the java task does not fail even though the validation failed. I think I 
remember reading something about that ages ago... Note that my task is actually 
a macro which does other validation too..
      <java fork="true" classname="com.saxonica.Validate" failonerror="true"
        resultproperty="rcodeSaxonValidate">
        <classpath>
          <pathelement location="${SaxonJar}"/>
        </classpath>
        <arg value="-s:@{in}"/>
        <arg value="-xsd:@{xsd}"/>
        <arg value="-val:@{validationlevel}"/>
      </java>

I include here Mike Kay's offline assessment of using saxon validate inside ant.

>It looks as if this task relies on the validation engine implementing 
>XMLReader - that is, it's assuming validation is something that parsers do.
>I would have expected something that expects to work with any validation 
>engine to use javax.xml.vaidation.Validator, or ValidationHandler, both of 
>which Saxon does implement.  I guess it's easy enough to provide a wrapper 
>that implements XMLReader if people need it.
>
>It's just a shame that ValidatorHandler is a concrete class rather than an 
>interface. Otherwise I could have made ValidatorHandlerImpl extend XMLFilter, 
>>and you would get an XMLReader for free.
>
>Regards,
>
>Mike

>>Hi Mike, this looks like a similar problem that I have faced  (and run 
>>away from).
>>
>> I reverted in the end to calling saxon directly from the command 
>>line for validation..

Hope this helps

Cheers
Graham


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to