ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: Capturing XML validation output
Date Tue, 12 Jul 2005 01:47:48 GMT
Yaakov,

You need to iterate over your directories and do the
validating operation for each of them. You may find
<for> task[1] useful (untested pseudo code):

<property name="fs" value="${file.separator}"/>
<for param="dir">
  <dirset dir="...">
    <include name="...">
  </dirset>
  <record action="start" name="@{dir}"/>
  <xmlvalidate file="@{dir}${fs}filename.xml">
    <dtd publicid location="@{dir}${fs}filename.dtd"/>
  </xmlvalidate>
  <record action="stop"/>
</for>

HTH Ivan
[1]http://ant-contrib.sourceforge.net/tasks/tasks/for.html

--- Yaakov Chaikin <yaakov.chaikin@gmail.com> wrote:

> Thanks to both of you for replying. However, how
> would I have each
> directory have its own dtdOutput.txt?
> 
> Thanks,
> Yaakov.
> 
> On 7/10/05, Kristian Perkins <khperkins@bigpond.com>
> wrote:
> > I didn't think you could nest tasks inside
> <record>, in which case you might like to try
> something like this untested version:
> > 
> > <record name="dtdOutput.txt" action="start"/>
> > <xmlvalidate file="filename.xml">
> >  <dtd publicId="..." location="filename.dtd"/>
> > </xmlvalidate>
> > <record name="dtdOutput.txt" action="stop"/>
> > 
> > 
> > 
> > Ivan Ivanov wrote:
> > 
> > >Yaakov,
> > >
> > >I think that you can use <xmlvalidate>[1] task
> for
> > >validation of your xml files and <record> task to
> > >capture the output of the validation (untested
> but
> > >might give you an idea):
> > >
> > ><record name="dtdOutput.txt" action="start">
> > ><xmlvalidate file="filename.xml">
> > >  <dtd publicId="..." location="filename.dtd"/>
> > ></xmlvalidate>
> > ></record>
> > >
> > >HTH Ivan
> > >
> >
>
>[1]http://ant.apache.org/manual/OptionalTasks/xmlvalidate.html
> >
>
>[2]http://ant.apache.org/manual/CoreTasks/recorder.html
> > >
> > >--- Yaakov Chaikin <yaakov.chaikin@gmail.com>
> wrote:
> > >
> > >
> > >
> > >>Hi,
> > >>
> > >>Could someone point me in the right direction on
> the
> > >>following...
> > >>
> > >>I have these directories:
> > >>
> > >>root
> > >>  project1
> > >>  project2
> > >>  project3
> > >>...
> > >>
> > >>Each project contains XML file declared with a
> DTD,
> > >>the DTD file, XML
> > >>file declared with a Schema, the Schema file.
> > >>
> > >>What I would like to get ANT to do is to
> validate
> > >>both XML files and
> > >>capture the output of any errors inside 2 files:
> > >>dtdOutput.txt and
> > >>schemaOutput.txt. Each file should be placed
> > >>alongside the
> > >>XML/DTD/Schema file(s), so the file with the
> output
> > >>file of the set of
> > >>files would be in the same directory as those
> files.
> > >>
> > >>Any direction on this would be appreciated.
> > >>
> > >>Thanks,
> > >>Yaakov.
> > >>
> > >>
> > >>
> > >>
> >
>
>---------------------------------------------------------------------
> > >
> > >
> > >>To unsubscribe, e-mail:
> > >>user-unsubscribe@ant.apache.org
> > >>For additional commands, e-mail:
> > >>user-help@ant.apache.org
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> >
> >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > >http://mail.yahoo.com
> > >
> >
>
>---------------------------------------------------------------------
> > >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
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/

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


Mime
View raw message