You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Thorsten Scherler <th...@juntadeandalucia.es> on 2009/03/09 13:35:44 UTC

Changes to tidy-config.txt

Hi all,

I played around with 
$FORREST_HOME/etc/tidy-xml.pl 
in a custom project where I need to clean up the white spaces. 

For now we have not set the encoding in our configuration, this however
can lead to problems in combination with 
add-xml-decl: yes

If you have a xml file that did not had a xml declaration, tidy will add
one and use the default encoding which is "us-ascii".

I needed to add "char-encoding: utf8" to the config to get rid of
invalid character error that all my utf-8 characters had thrown.

Another thing is the indent of all attributes. IMO that it just too much
since if you have an element with 5 attributes you will have it now in 6
lines.

I propose the following change:
Index: etc/tidy-config.txt
===================================================================
--- etc/tidy-config.txt	(revision 748122)
+++ etc/tidy-config.txt	(working copy)
@@ -1,8 +1,9 @@
 add-xml-decl: yes
+char-encoding: utf8
 input-xml: yes
 output-xml:yes
 indent: auto
-indent-attributes: yes
+indent-attributes: no
 indent-spaces: 2
 write-back: yes
 preserve-entities: yes

wdyt?

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la InformaciĆ³n, S.A.U. (SADESI)





Re: Changes to tidy-config.txt

Posted by Sjur Moshagen <sj...@mac.com>.
Den 9. mar. 2009 kl. 14.35 skrev Thorsten Scherler:

> I propose the following change:
> Index: etc/tidy-config.txt
> ===================================================================
> --- etc/tidy-config.txt	(revision 748122)
> +++ etc/tidy-config.txt	(working copy)
> @@ -1,8 +1,9 @@
> add-xml-decl: yes
> +char-encoding: utf8
> input-xml: yes
> output-xml:yes
> indent: auto
> -indent-attributes: yes
> +indent-attributes: no
> indent-spaces: 2
> write-back: yes
> preserve-entities: yes
>
> wdyt?

+1

Sjur


Re: Changes to tidy-config.txt

Posted by David Crossley <cr...@apache.org>.
David Crossley wrote:
> Thorsten Scherler wrote:
> > 
> > I played around with 
> > $FORREST_HOME/etc/tidy-xml.pl 
> > in a custom project where I need to clean up the white spaces. 
> 
> At Forrest we do not use that old experiment.
> Probably should remove it, as is seems to confuse.
> 
> See my answer to Gavin a few weeks ago.
> There is an "xmlformat" task in main/build.xml
> which uses etc/xmlformat.conf
> 
> I did heaps of work with this just before our last
> release, and found it to be much much better than
> using tidy.

See also https://issues.apache.org/jira/browse/FOR-644
after 2007-04-02.

-David

Re: Changes to tidy-config.txt

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Wed, 2009-03-11 at 15:19 +1100, David Crossley wrote:
> Thorsten Scherler wrote:
> > Hi all,
> > 
> > I played around with 
> > $FORREST_HOME/etc/tidy-xml.pl 
> > in a custom project where I need to clean up the white spaces. 
> 
> At Forrest we do not use that old experiment.
> Probably should remove it, as is seems to confuse.
> 
> See my answer to Gavin a few weeks ago.
> There is an "xmlformat" task in main/build.xml
> which uses etc/xmlformat.conf
> 
> I did heaps of work with this just before our last
> release, and found it to be much much better than
> using tidy.

Thanks for explaining. I found that tidy broke my xsl:text elements
(which are supposed to be printed as is) and that leaded to a couple of
bugs where I saw &#10; in the paths.

Will need to look into the task.

Gracias y salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la InformaciĆ³n, S.A.U. (SADESI)





Re: Changes to tidy-config.txt

Posted by David Crossley <cr...@apache.org>.
Thorsten Scherler wrote:
> Hi all,
> 
> I played around with 
> $FORREST_HOME/etc/tidy-xml.pl 
> in a custom project where I need to clean up the white spaces. 

At Forrest we do not use that old experiment.
Probably should remove it, as is seems to confuse.

See my answer to Gavin a few weeks ago.
There is an "xmlformat" task in main/build.xml
which uses etc/xmlformat.conf

I did heaps of work with this just before our last
release, and found it to be much much better than
using tidy.

-David

> For now we have not set the encoding in our configuration, this however
> can lead to problems in combination with 
> add-xml-decl: yes
> 
> If you have a xml file that did not had a xml declaration, tidy will add
> one and use the default encoding which is "us-ascii".
> 
> I needed to add "char-encoding: utf8" to the config to get rid of
> invalid character error that all my utf-8 characters had thrown.
> 
> Another thing is the indent of all attributes. IMO that it just too much
> since if you have an element with 5 attributes you will have it now in 6
> lines.
> 
> I propose the following change:
> Index: etc/tidy-config.txt
> ===================================================================
> --- etc/tidy-config.txt	(revision 748122)
> +++ etc/tidy-config.txt	(working copy)
> @@ -1,8 +1,9 @@
>  add-xml-decl: yes
> +char-encoding: utf8
>  input-xml: yes
>  output-xml:yes
>  indent: auto
> -indent-attributes: yes
> +indent-attributes: no
>  indent-spaces: 2
>  write-back: yes
>  preserve-entities: yes
> 
> wdyt?
> 
> salu2
> -- 
> Thorsten Scherler <thorsten.at.apache.org>
> Open Source Java <consulting, training and solutions>
> 
> Sociedad Andaluza para el Desarrollo de la Sociedad 
> de la Informaci??n, S.A.U. (SADESI)
> 
> 
> 
>