You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by dominic Tippabattuni <do...@gmail.com> on 2011/06/06 17:08:42 UTC

verifying encoding value using xmlvalidate task

Hi,

I am working on a task which can verify xml encoding value. All xml files in
the project should be verified.
It would be great if someone can point me in the right direction.

The line in the xml file which needs to be verified is
<?xml version = '1.0' encoding = 'UTF-8' ?>

Thanks
Nick

Re: verifying encoding value using xmlvalidate task

Posted by Vimil Saju <vi...@yahoo.com>.
If the only requirement is to check if the first line of the file is <?xml version = '1.0' encoding = 'UTF-8' ?> then I don't think you need to use xmltask. You can do something as follows

<loadfile srcfile="${src.file}" property="src.file.head"> <filterchain> <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> <param name="lines" value="1"/> </filterreader> </filterchain>
</loadfile>
Theabove task will load the first line of a file into the property src.file.head. You can then check if it matches with '<?xml version = '1.0' encoding = 'UTF-8' ?>'


________________________________
From: Grüner Heinrich <gr...@googlemail.com>
To: Ant Users List <us...@ant.apache.org>
Sent: Tuesday, June 7, 2011 6:22 AM
Subject: Re: verifying encoding value using xmlvalidate task

Hi Dominic,
maybe you should check out the xmltask.
http://www.oopsconsultancy.com/software/xmltask/
I don't know exactly, but somehow it should be possible to extract the 
header and even manipulate it.


Regards,
Stefan.

Am 07.06.2011 15:04, schrieb dominic Tippabattuni:
> Hi Parag,
>
> My intent is to check the presence of encoding value in xml files.
>
> Thanks
> Dominic
>
> On Tue, Jun 7, 2011 at 12:07 AM, Parag Doke<pa...@gmail.com>  wrote:
>
>> Hi Dominic.
>> I'm no ant expert, but just trying to understand the requirement.
>> If you intent to check presence of encoding value in XML files ?
>> Or is your intent to validate the XML files using the encoding ?
>>
>> Thanks in advance,
>> Parag Doke
>> Save paper, save trees. Do not print emails/documents unless
>> absolutely necessary.
>>
>>
>>
>> On Mon, Jun 6, 2011 at 8:38 PM, dominic Tippabattuni
>> <do...@gmail.com>  wrote:
>>> Hi,
>>>
>>> I am working on a task which can verify xml encoding value. All xml files
>> in
>>> the project should be verified.
>>> It would be great if someone can point me in the right direction.
>>>
>>> The line in the xml file which needs to be verified is
>>> <?xml version = '1.0' encoding = 'UTF-8' ?>
>>>
>>> Thanks
>>> Nick
>>>
>> ---------------------------------------------------------------------
>> 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: verifying encoding value using xmlvalidate task

Posted by Grüner Heinrich <gr...@googlemail.com>.
Hi Dominic,
maybe you should check out the xmltask.
http://www.oopsconsultancy.com/software/xmltask/
I don't know exactly, but somehow it should be possible to extract the 
header and even manipulate it.


Regards,
Stefan.

Am 07.06.2011 15:04, schrieb dominic Tippabattuni:
> Hi Parag,
>
> My intent is to check the presence of encoding value in xml files.
>
> Thanks
> Dominic
>
> On Tue, Jun 7, 2011 at 12:07 AM, Parag Doke<pa...@gmail.com>  wrote:
>
>> Hi Dominic.
>> I'm no ant expert, but just trying to understand the requirement.
>> If you intent to check presence of encoding value in XML files ?
>> Or is your intent to validate the XML files using the encoding ?
>>
>> Thanks in advance,
>> Parag Doke
>> Save paper, save trees. Do not print emails/documents unless
>> absolutely necessary.
>>
>>
>>
>> On Mon, Jun 6, 2011 at 8:38 PM, dominic Tippabattuni
>> <do...@gmail.com>  wrote:
>>> Hi,
>>>
>>> I am working on a task which can verify xml encoding value. All xml files
>> in
>>> the project should be verified.
>>> It would be great if someone can point me in the right direction.
>>>
>>> The line in the xml file which needs to be verified is
>>> <?xml version = '1.0' encoding = 'UTF-8' ?>
>>>
>>> Thanks
>>> Nick
>>>
>> ---------------------------------------------------------------------
>> 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: verifying encoding value using xmlvalidate task

Posted by dominic Tippabattuni <do...@gmail.com>.
Hi Parag,

My intent is to check the presence of encoding value in xml files.

Thanks
Dominic

On Tue, Jun 7, 2011 at 12:07 AM, Parag Doke <pa...@gmail.com> wrote:

> Hi Dominic.
> I'm no ant expert, but just trying to understand the requirement.
> If you intent to check presence of encoding value in XML files ?
> Or is your intent to validate the XML files using the encoding ?
>
> Thanks in advance,
> Parag Doke
> Save paper, save trees. Do not print emails/documents unless
> absolutely necessary.
>
>
>
> On Mon, Jun 6, 2011 at 8:38 PM, dominic Tippabattuni
> <do...@gmail.com> wrote:
> > Hi,
> >
> > I am working on a task which can verify xml encoding value. All xml files
> in
> > the project should be verified.
> > It would be great if someone can point me in the right direction.
> >
> > The line in the xml file which needs to be verified is
> > <?xml version = '1.0' encoding = 'UTF-8' ?>
> >
> > Thanks
> > Nick
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: verifying encoding value using xmlvalidate task

Posted by Parag Doke <pa...@gmail.com>.
Hi Dominic.
I'm no ant expert, but just trying to understand the requirement.
If you intent to check presence of encoding value in XML files ?
Or is your intent to validate the XML files using the encoding ?

Thanks in advance,
Parag Doke
Save paper, save trees. Do not print emails/documents unless
absolutely necessary.



On Mon, Jun 6, 2011 at 8:38 PM, dominic Tippabattuni
<do...@gmail.com> wrote:
> Hi,
>
> I am working on a task which can verify xml encoding value. All xml files in
> the project should be verified.
> It would be great if someone can point me in the right direction.
>
> The line in the xml file which needs to be verified is
> <?xml version = '1.0' encoding = 'UTF-8' ?>
>
> Thanks
> Nick
>

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