BizTalk Server General - Element vs. Attribute guidelines

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > November 2004 > Element vs. Attribute guidelines





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Element vs. Attribute guidelines
Hugo Rodger-Brown

2004-11-10, 7:47 am

I'm putting together some guidelines on schema form and would like to get
other people's opinions on the element v attribute question.

Consider the following:

<People>
<Person name="joe" age="30" />
</People>

or

<People>
<Person>
<Name>joe</Name>
<Age>30</Age>
</Person>
</People>

Does anyone know of any guidelines on this? As a rule I tend to go for the
attribute form - as it's lighter - but I don't really have any great
argument either way?

Hugo
http://hugo.rodger-brown.com


Bob C.

2004-11-10, 5:48 pm

Sun has some sensible guidelines regarding elements vs. attrributes:
http://java.sun.com/xml/jaxp/dist/1...w/4_design.html

"Hugo Rodger-Brown" wrote:

> I'm putting together some guidelines on schema form and would like to get
> other people's opinions on the element v attribute question.
>
> Consider the following:
>
> <People>
> <Person name="joe" age="30" />
> </People>
>
> or
>
> <People>
> <Person>
> <Name>joe</Name>
> <Age>30</Age>
> </Person>
> </People>
>
> Does anyone know of any guidelines on this? As a rule I tend to go for the
> attribute form - as it's lighter - but I don't really have any great
> argument either way?
>
> Hugo
> http://hugo.rodger-brown.com
>
>
>

Yossi Dahan

2004-11-11, 2:46 am

I've read somewhere once (sorry, can't remember when)
a nice rule of thumb I've adopted:
If the entity, the value, can exist on its own, its an element, if not its
an attribute.

Yossi Dahan

"Hugo Rodger-Brown" <hugo@coldhams.com> wrote in message
news:%23I8sWCzxEHA.1292@TK2MSFTNGP10.phx.gbl...
> I'm putting together some guidelines on schema form and would like to get
> other people's opinions on the element v attribute question.
>
> Consider the following:
>
> <People>
> <Person name="joe" age="30" />
> </People>
>
> or
>
> <People>
> <Person>
> <Name>joe</Name>
> <Age>30</Age>
> </Person>
> </People>
>
> Does anyone know of any guidelines on this? As a rule I tend to go for the
> attribute form - as it's lighter - but I don't really have any great
> argument either way?
>
> Hugo
> http://hugo.rodger-brown.com
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com