[Geoserver-devel] XML formatting best practices?

Hey all,

So I had to go in and edit a POM with a not-so-smart editor today, and it turns out much of the *raw* text in the gs poms is totally fubared.

Anyone who has a 'smart' xml editor, or who has tabs set to 2 spaces will see a normal XML file. Anyone who has a 'dumb' xml editor (particularly one set to have tabs = 4 spaces) will see a schizophrenic one.

I suggest that we either decide that poms are formatted with TABS *or* with SPACES. If tabs, that means anyone can set their tab stop to whatever they wish, and they'll see it as though it's indented with 'x' number of spaces. If spaces, then everyone will see the same number of spaces.

From what I understand this is an emacs v. vi debate. Nobody's right, and everybody argues about it. I don't actually care about the result...just wish that opening the XML files would be consistent somewhere.

For the sake of the debate, I have flipped a coin and am advocating...SPACES.

Anyone else think this is important enough for me to go and format all our XML files consistently this way? Don't mean to waste anybodies time with this, but before I go crazy and reformat all the poms I figure I'd check in to see if this is a general problem for others.

--saul

Yes!! I brought this up before. There is a nice command line utility called xmlformat, i would be happy to format all the poms. However the result is not that pretty, it seems to get rid of blank lines between elements. So

<build>
...
</build>

<properties>
...
</properties>

becomes:

<build>
...
</build>
<properties>
...
</properties>

It also has issues with comments, they dont seem to be intented. Although there are lots of options, there is problably a way to configure this behaviour.

I am also there sure there are many editors that will do a better job of this so if someone wants to do it i am a big +1.

-Justin

Farber, Saul (ENV) wrote:

Hey all,

So I had to go in and edit a POM with a not-so-smart editor today, and it turns out much of the *raw* text in the gs poms is totally fubared.

Anyone who has a 'smart' xml editor, or who has tabs set to 2 spaces will see a normal XML file. Anyone who has a 'dumb' xml editor (particularly one set to have tabs = 4 spaces) will see a schizophrenic one.

I suggest that we either decide that poms are formatted with TABS *or* with SPACES. If tabs, that means anyone can set their tab stop to whatever they wish, and they'll see it as though it's indented with 'x' number of spaces. If spaces, then everyone will see the same number of spaces.

From what I understand this is an emacs v. vi debate. Nobody's right, and everybody argues about it. I don't actually care about the result...just wish that opening the XML files would be consistent somewhere.

For the sake of the debate, I have flipped a coin and am advocating...SPACES.

Anyone else think this is important enough for me to go and format all our XML files consistently this way? Don't mean to waste anybodies time with this, but before I go crazy and reformat all the poms I figure I'd check in to see if this is a general problem for others.

--saul

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,4602b694130689771116852!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

I'm willing to just fix them as it bugs me (and eventually every pom will bug someone).

I'm a little reluctant to just go 'do my thang' to all the poms without some kind of consensus about what a proper 'format' looks like. It might bug someone using a particular editor and it's a bit of an arbitrary change (why spaces and not tabs?)

So it sounds like we have two +1s for A STANDARD. I flipped a coin and said SPACES should be the standard, I'd feel comfortable acting as soon as some reasonable number of +1s come along. Say five of them? Four?

--saul

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Thu 3/22/2007 1:06 PM
To: Farber, Saul (ENV)
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] XML formatting best practices?

Yes!! I brought this up before. There is a nice command line utility
called xmlformat, i would be happy to format all the poms. However the
result is not that pretty, it seems to get rid of blank lines between
elements. So

<build>
...
</build>

<properties>
...
</properties>

becomes:

<build>
...
</build>
<properties>
...
</properties>

It also has issues with comments, they dont seem to be intented.
Although there are lots of options, there is problably a way to
configure this behaviour.

I am also there sure there are many editors that will do a better job of
this so if someone wants to do it i am a big +1.

-Justin

Farber, Saul (ENV) wrote:

Hey all,

So I had to go in and edit a POM with a not-so-smart editor today, and it turns out much of the *raw* text in the gs poms is totally fubared.

Anyone who has a 'smart' xml editor, or who has tabs set to 2 spaces will see a normal XML file. Anyone who has a 'dumb' xml editor (particularly one set to have tabs = 4 spaces) will see a schizophrenic one.

I suggest that we either decide that poms are formatted with TABS *or* with SPACES. If tabs, that means anyone can set their tab stop to whatever they wish, and they'll see it as though it's indented with 'x' number of spaces. If spaces, then everyone will see the same number of spaces.

From what I understand this is an emacs v. vi debate. Nobody's right, and everybody argues about it. I don't actually care about the result...just wish that opening the XML files would be consistent somewhere.

For the sake of the debate, I have flipped a coin and am advocating...SPACES.

Anyone else think this is important enough for me to go and format all our XML files consistently this way? Don't mean to waste anybodies time with this, but before I go crazy and reformat all the poms I figure I'd check in to see if this is a general problem for others.

--saul

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,4602b694130689771116852!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

At least one of the eclipse plugins has an xml format settings (maybe as part of the WTP?). Anything automatic we can do....
Jody

I'm willing to just fix them as it bugs me (and eventually every pom will bug someone).

I'm a little reluctant to just go 'do my thang' to all the poms without some kind of consensus about what a proper 'format' looks like. It might bug someone using a particular editor and it's a bit of an arbitrary change (why spaces and not tabs?)

So it sounds like we have two +1s for A STANDARD. I flipped a coin and said SPACES should be the standard, I'd feel comfortable acting as soon as some reasonable number of +1s come along. Say five of them? Four?

--saul

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Thu 3/22/2007 1:06 PM
To: Farber, Saul (ENV)
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] XML formatting best practices?
Yes!! I brought this up before. There is a nice command line utility called xmlformat, i would be happy to format all the poms. However the result is not that pretty, it seems to get rid of blank lines between elements. So

<build>
...
</build>

<properties>
...
</properties>

becomes:

<build>
...
</build>
<properties>
...
</properties>

It also has issues with comments, they dont seem to be intented. Although there are lots of options, there is problably a way to configure this behaviour.

I am also there sure there are many editors that will do a better job of this so if someone wants to do it i am a big +1.

-Justin

Farber, Saul (ENV) wrote:
  

Hey all,

So I had to go in and edit a POM with a not-so-smart editor today, and it turns out much of the *raw* text in the gs poms is totally fubared.

Anyone who has a 'smart' xml editor, or who has tabs set to 2 spaces will see a normal XML file. Anyone who has a 'dumb' xml editor (particularly one set to have tabs = 4 spaces) will see a schizophrenic one.

I suggest that we either decide that poms are formatted with TABS *or* with SPACES. If tabs, that means anyone can set their tab stop to whatever they wish, and they'll see it as though it's indented with 'x' number of spaces. If spaces, then everyone will see the same number of spaces.

>From what I understand this is an emacs v. vi debate. Nobody's right, and everybody argues about it. I don't actually care about the result...just wish that opening the XML files would be consistent somewhere.

For the sake of the debate, I have flipped a coin and am advocating...SPACES.

Anyone else think this is important enough for me to go and format all our XML files consistently this way? Don't mean to waste anybodies time with this, but before I go crazy and reformat all the poms I figure I'd check in to see if this is a general problem for others.

--saul

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,4602b694130689771116852!

Farber, Saul (ENV) ha scritto:

I'm willing to just fix them as it bugs me (and eventually every pom will bug someone).

I'm a little reluctant to just go 'do my thang' to all the poms without some kind of consensus about what a proper 'format' looks like. It might bug someone using a particular editor and it's a bit of an arbitrary change (why spaces and not tabs?)

So it sounds like we have two +1s for A STANDARD. I flipped a coin and said SPACES should be the standard, I'd feel comfortable acting as soon as some reasonable number of +1s come along. Say five of them? Four?

+1 standard
+1 spaces (two, four, I don't care)

Cheers
Andrea

Jody Garnett wrote:

At least one of the eclipse plugins has an xml format settings (maybe as part of the WTP?). Anything automatic we can do....

Yeha, we could set up a nightly script to xmlformat the files. But I think that may be overkill. Just batch formatting them once and a awhile or when someones sees a formatting issue should be good enough i would think.

Jody

I'm willing to just fix them as it bugs me (and eventually every pom will bug someone).

I'm a little reluctant to just go 'do my thang' to all the poms without some kind of consensus about what a proper 'format' looks like. It might bug someone using a particular editor and it's a bit of an arbitrary change (why spaces and not tabs?)

So it sounds like we have two +1s for A STANDARD. I flipped a coin and said SPACES should be the standard, I'd feel comfortable acting as soon as some reasonable number of +1s come along. Say five of them? Four?

--saul

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Thu 3/22/2007 1:06 PM
To: Farber, Saul (ENV)
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] XML formatting best practices?
Yes!! I brought this up before. There is a nice command line utility called xmlformat, i would be happy to format all the poms. However the result is not that pretty, it seems to get rid of blank lines between elements. So

<build>
...
</build>

<properties>
...
</properties>

becomes:

<build>
...
</build>
<properties>
...
</properties>

It also has issues with comments, they dont seem to be intented. Although there are lots of options, there is problably a way to configure this behaviour.

I am also there sure there are many editors that will do a better job of this so if someone wants to do it i am a big +1.

-Justin

Farber, Saul (ENV) wrote:
  

Hey all,

So I had to go in and edit a POM with a not-so-smart editor today, and it turns out much of the *raw* text in the gs poms is totally fubared.

Anyone who has a 'smart' xml editor, or who has tabs set to 2 spaces will see a normal XML file. Anyone who has a 'dumb' xml editor (particularly one set to have tabs = 4 spaces) will see a schizophrenic one.

I suggest that we either decide that poms are formatted with TABS *or* with SPACES. If tabs, that means anyone can set their tab stop to whatever they wish, and they'll see it as though it's indented with 'x' number of spaces. If spaces, then everyone will see the same number of spaces.

>From what I understand this is an emacs v. vi debate. Nobody's right, and everybody argues about it. I don't actually care about the result...just wish that opening the XML files would be consistent somewhere.

For the sake of the debate, I have flipped a coin and am advocating...SPACES.

Anyone else think this is important enough for me to go and format all our XML files consistently this way? Don't mean to waste anybodies time with this, but before I go crazy and reformat all the poms I figure I'd check in to see if this is a general problem for others.

--saul

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,4602ba66134071804284693!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Jody Garnett ha scritto:

At least one of the eclipse plugins has an xml format settings (maybe as part of the WTP?). Anything automatic we can do....

I already tried two times to find a formatter like jalopy for xml
files... no luck. The closest one is jtidy, but it's designed
for html...

We could try to roll our own, that is, parse and rewrite, not sure
we would keep all the contents thought...

Cheers
Andrea