ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huditsch, Roman \(LNG-VIE\)" <>
Subject AW: using <xmlvalidate> task with XML Schema 1.1 and Saxon
Date Mon, 10 May 2010 09:51:51 GMT
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).


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

LexisNexis Verlag ARD Orac GmbH & Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
-----Urspr√ľngliche Nachricht-----

Von: Heath, Graham [] 
Gesendet: Montag, 10. Mai 2010 11:19
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"
          <pathelement location="${SaxonJar}"/>
        <arg value="-s:@{in}"/>
        <arg value="-xsd:@{xsd}"/>
        <arg value="-val:@{validationlevel}"/>

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.

>>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


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

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

View raw message