forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diwaker Gupta <>
Subject Re: Automated formatting of XML files
Date Fri, 26 Aug 2005 18:01:52 GMT
On 8/25/05, David Crossley <> wrote:
> Diwaker Gupta wrote:
> > When I say XML, I mean all kinds of XML files (XSL, *.fv, *.ft)
> How will the tool know which are xml file-types?
> We have a multitude of xml filename extensions.
> There is a list on one of the tools in the
> "committers" svn repository at relicense/src/

I don't see why this is a problem. I'll just write a simple script
that runs the tool on whatever extensions we use for XML files. Tidy
doesn't know/care about the file extension -- you just feed it some
input, and it gives you the output.

> I think that it is doing too much, e.g. removing the
> blank lines before major elements, e.g. <xsl:template>

Like I said, its configurable. We can pick and choose. Since this is
an automated process, I'm not too worried about the tool doing "too
much" -- just change the config, re run and voila!

> We should start with very simple stuff, e.g. just tabs
> and trailing whitespace, then gradually add other operations.
> However we don't want to get too strict on code style.


> I suggest that we define a list of what we would possibly
> want to adrress. Here is a start:
> 1 whitespace at end-of-line

> 2 tabs to four-space

You mean 2 spaces.

> 3 indentation


> 4 word-wrap for long lines

What would be a good length? Right now I use 80.

> 5 whitespace between attribute definitions


> We need to at least do 1 and 2 while 5 may be doubtful.
> It seems to be too vigorous with wrapping. Perhaps wider
> would be better.
> <   <xsl:key name="h5s" match="h5" use="generate-id(preceding-sibling::h4[1])"/>
> ---
> >   <xsl:key name="h5s" match="h5"
> >   use="generate-id(preceding-sibling::h4[1])" />

It won't wrap if there are no spaces to break the line at. It won't
wrap between attribute values (I think this is configurable though). I
usually use 80 in my editor as well, so this works for me. We can set
it to 100 or something else if that works for more people.

> Also we need to run it on one of the xdocs
> in site-author/content/xdocs to see what it does
> with word-wrapping for long lines of element content.

I'll do this soon.


View raw message