You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Madunic, Marijan (RBI-US)" <ma...@reedbusiness.com> on 2008/04/16 17:34:54 UTC

XSLT task fail rerouting

I've been looking at the attributes available to the XSLT task on do not
see an attribute to define what to do if the xslt task fails.

 

A bit of background first. Myself and a colleague are parsing 10s of
thousands of XML files and every now and then an ill formed XML doc
comes along. When this happens the entire process is terminated and we
would like for the process to continue and to move the offending file to
a directory to be parsed via tagsoup and then reparsed using the XSLT
task.

 

So my questions are:

 

Does the fail task work as a child of xslt?

If not what if anything can we do to stop the termination of the process
if an ill formed XML doc comes along?

 

Thanks, any ideas will be appreciated

 

Marijan (Mario) Madunic
Developer
Reed Business Information
604.412.2212 Direct - Vancouver

604.418.9327 Blackberry - Canada
marijan.madunic@reedbusiness.com
<ma...@reedbusiness.com> 
www.reedbusiness.com <http://www.reedbusiness.com/>  

 


Re: XSLT task fail rerouting

Posted by Mario Madunic <ha...@imag.net>.
Thank you Steve for the quick response. How do I post a feature request. I've
never used bugzilla and when I went to the site I found it a bit daunting.

I've found Antxtras that should be able to help. When I figure it out I'll post
it to the list.

Marijan (Mario) Madunic

Quoting Steve Loughran <st...@apache.org>:

> Madunic, Marijan (RBI-US) wrote:
> > I've been looking at the attributes available to the XSLT task on do not
> > see an attribute to define what to do if the xslt task fails.
> > 
> >  
> > 
> > A bit of background first. Myself and a colleague are parsing 10s of
> > thousands of XML files and every now and then an ill formed XML doc
> > comes along. When this happens the entire process is terminated and we
> > would like for the process to continue and to move the offending file to
> > a directory to be parsed via tagsoup and then reparsed using the XSLT
> > task.
> > 
> >  
> > 
> > So my questions are:
> > 
> >  
> > 
> > Does the fail task work as a child of xslt?
> > 
> > If not what if anything can we do to stop the termination of the process
> > if an ill formed XML doc comes along?
> 
> sounds like that is a bit of feature creep. If it is 
> xml-well-formedness, then <xmlvalidate> and its child <schemavalidate> 
> should do the work...what we want is for them to be able to create a 
> refid to all the validated files, which could then be used to validate 
> the components.  And a reference to all the invalid files to.
> 
> If such attrs existed you could go
> 
> <xmlvalidate validref="valid.xml" invalidref="invalid.xml">
>   <fileset dir="xml" includes="**/*.html" />
> </xmlvalidate>
> <copy refid="valid.xml" destdir="build/xml/valid" />
> <copy refid="invalid.xml" destdir="build/xml/tofix" />
> ...
> 
> Something to add as a feature request (better yet, with patches and 
> docs) to bugzilla
> 
> -steve
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 



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


Re: XSLT task fail rerouting

Posted by Steve Loughran <st...@apache.org>.
Madunic, Marijan (RBI-US) wrote:
> I've been looking at the attributes available to the XSLT task on do not
> see an attribute to define what to do if the xslt task fails.
> 
>  
> 
> A bit of background first. Myself and a colleague are parsing 10s of
> thousands of XML files and every now and then an ill formed XML doc
> comes along. When this happens the entire process is terminated and we
> would like for the process to continue and to move the offending file to
> a directory to be parsed via tagsoup and then reparsed using the XSLT
> task.
> 
>  
> 
> So my questions are:
> 
>  
> 
> Does the fail task work as a child of xslt?
> 
> If not what if anything can we do to stop the termination of the process
> if an ill formed XML doc comes along?

sounds like that is a bit of feature creep. If it is 
xml-well-formedness, then <xmlvalidate> and its child <schemavalidate> 
should do the work...what we want is for them to be able to create a 
refid to all the validated files, which could then be used to validate 
the components.  And a reference to all the invalid files to.

If such attrs existed you could go

<xmlvalidate validref="valid.xml" invalidref="invalid.xml">
  <fileset dir="xml" includes="**/*.html" />
</xmlvalidate>
<copy refid="valid.xml" destdir="build/xml/valid" />
<copy refid="invalid.xml" destdir="build/xml/tofix" />
...

Something to add as a feature request (better yet, with patches and 
docs) to bugzilla

-steve


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