This page is no longer maintained — Please continue to the home page at www.scala-lang.org

[scala-bts] #2735: Preserve attribute order && Keep Tags minimized

7 replies
Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.

-------------------------------------------+--------------------------------
Reporter: behlma | Owner: scala-xml_team
Type: enhancement | Status: new
Priority: normal | Component: XML support
Keywords: XML, attribute, tag, minimized |
-------------------------------------------+--------------------------------
I have to automatically create a lot of JNDI environment variables like
the following:

Now no matter what I do, Scala will always put the "name" attribute last,
i.e. change attribute ordering and also expand my empty tag. I searched
the mailing list for a solution to the expanding problem, but in Snapshot
2.8.0 there doesn't seem to be an easy one. The end result is this:

Now I'd love to have the attribute order preserved, as scanning variables
(with my human eyes :) ) by the "name" attribute in a jndi config file is
a very common thing to do. I can live with the tag expansion, even though
it adds a bit of bloat and wonder why Scala expands my empty tag in the
first place: I would write down the expanded version if I wanted to.

Thanks guys!

Anthony B. Coates
Joined: 2009-09-12,
User offline. Last seen 2 years 35 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags mi

As regards implementing empty elements rather than full open/close tags, I
have a 5-line modification that does this when using PrettyPrinter.
What's the right process to contribute something like that? Thanks,

Cheers, Tony.

On Mon, 30 Nov 2009 10:59:31 -0000, Scala wrote:

> #2735: Preserve attribute order && Keep Tags minimized
> -------------------------------------------+--------------------------------
> Reporter: behlma | Owner: scala-xml_team
> Type: enhancement | Status: new
> Priority: normal | Component: XML support
> Keywords: XML, attribute, tag, minimized |
> -------------------------------------------+--------------------------------
> I have to automatically create a lot of JNDI environment variables like
> the following:
>
> override="false" />
>
> Now no matter what I do, Scala will always put the "name" attribute
> last,
> i.e. change attribute ordering and also expand my empty tag. I searched
> the mailing list for a solution to the expanding problem, but in
> Snapshot
> 2.8.0 there doesn't seem to be an easy one. The end result is this:
>
> name={key}>
>
> Now I'd love to have the attribute order preserved, as scanning
> variables
> (with my human eyes :) ) by the "name" attribute in a jndi config file
> is
> a very common thing to do. I can live with the tag expansion, even
> though
> it adds a bit of bloat and wonder why Scala expands my empty tag in the
> first place: I would write down the expanded version if I wanted to.
>
> Thanks guys!
>

Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags mi

On 09-12-08 01:25 PM, Anthony B. Coates (Londata) wrote:
> As regards implementing empty elements rather than full open/close
> tags, I have a 5-line modification that does this when using
> PrettyPrinter. What's the right process to contribute something like
> that?

Please attach a patch (preferably with test cases! :) to the ticket, I
think that's the best first step.

-0xe1a

Anthony B. Coates
Joined: 2009-09-12,
User offline. Last seen 2 years 35 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags mi

Test cases! Glad you mentioned them. I hadn't written any yet because I
wanted first to find out what the usual build/test process and environment
are, and to make sure that I had all existing tests working correctly. Is
there some documentation available about how to get that kind of
environment set up?

Thanks a lot in advance,

Cheers, Tony.

On Wed, 09 Dec 2009 17:59:17 -0000, Alex Cruise wrote:

> On 09-12-08 01:25 PM, Anthony B. Coates (Londata) wrote:
>> As regards implementing empty elements rather than full open/close
>> tags, I have a 5-line modification that does this when using
>> PrettyPrinter. What's the right process to contribute something like
>> that?
>
> Please attach a patch (preferably with test cases! :) to the ticket, I
> think that's the best first step.
>
> -0xe1a

Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags min

-------------------------------------------+--------------------------------
Reporter: behlma | Owner: scala-xml_team
Type: enhancement | Status: new
Priority: normal | Component: XML support
Keywords: XML, attribute, tag, minimized |
-------------------------------------------+--------------------------------
Changes (by dcsobral):

* cc: dcsobral@… (added)

Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags min

-------------------------------------------+--------------------------------
Reporter: behlma | Owner: scala-xml_team
Type: enhancement | Status: new
Priority: normal | Component: XML support
Keywords: XML, attribute, tag, minimized |
-------------------------------------------+--------------------------------
Changes (by bethard):

* cc: steven.bethard@… (added)

Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags min

-------------------------------------------+--------------------------------
Reporter: behlma | Owner: scala-xml_team
Type: enhancement | Status: new
Priority: normal | Component: XML support
Keywords: XML, attribute, tag, minimized |
-------------------------------------------+--------------------------------
Changes (by mgd):

* cc: mgd@… (added)

Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-bts] #2735: Preserve attribute order && Keep Tags min
-------------------------------------------+-------------------------------- Reporter: behlma | Owner: scala-xml_team Type: enhancement | Status: new Priority: normal | Component: XML support Keywords: XML, attribute, tag, minimized | -------------------------------------------+-------------------------------- Comment(by bethard): I just found a particularly nasty example of where not keeping tags minimized causes real problems. If I insert a "
" element in a HTML page, Scala expands that to "
" which is interpreted as two line breaks, not one, in both Firefox and Chrome.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland