advice on XML best practices

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

advice on XML best practices

dr.cw.ray
I was just wondering, as far as xml best practices go,  if all sibling
nodes should have identical attribute sets or is it okay if one or
more of the siblings has it's own unique attribute not included in the
other siblings, for example:

<topic>
     <post index="22"  user="martin">some content</post>
     <post index="34"  user="sherry">other content</post>
     <post index="1"  user="author" dummyPost="true"/>
</topic>

where that last post element has it's own unique @keep ?

Is XML flexible in this way, or, as far as best practices go, should
there be a greater attempt at consistency and uniformity in design
across all elements?

opinions?
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: advice on XML best practices

dr.cw.ray
On Jan 8, 10:52 am, "dr.cw.ray" <[hidden email]> wrote:

> I was just wondering, as far as xml best practices go,  if all sibling
> nodes should have identical attribute sets or is it okay if one or
> more of the siblings has it's own unique attribute not included in the
> other siblings, for example:
>
> <topic>
>      <post index="22"  user="martin">some content</post>
>      <post index="34"  user="sherry">other content</post>
>      <post index="1"  user="author" dummyPost="true"/>
> </topic>
>
> where that last post element has it's own unique @keep ?
>
> Is XML flexible in this way, or, as far as best practices go, should
> there be a greater attempt at consistency and uniformity in design
> across all elements?
>
> opinions?

sorry that should have been "where that last post element has it's own
unique @dummyPost?"
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: advice on XML best practices

Philipp Wagner-4
In reply to this post by dr.cw.ray
Am 08.01.2010 03:52, dr.cw.ray wrote:

> I was just wondering, as far as xml best practices go,  if all sibling
> nodes should have identical attribute sets or is it okay if one or
> more of the siblings has it's own unique attribute not included in the
> other siblings, for example:
>
> <topic>
>      <post index="22"  user="martin">some content</post>
>      <post index="34"  user="sherry">other content</post>
>      <post index="1"  user="author" dummyPost="true"/>
> </topic>
>
> where that last post element has it's own unique @keep ?
>
> Is XML flexible in this way, or, as far as best practices go, should
> there be a greater attempt at consistency and uniformity in design
> across all elements?

IMHO that's ok, HTML5 does it all the time (they only test for "is the
attribute present?"). And it makes your XML Schema easier in some cases.

Philipp
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms