Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > is this good practice ?

Reply
Thread Tools

is this good practice ?

 
 
Gieke
Guest
Posts: n/a
 
      07-24-2008
hi group,
I'm new here. Worked a bit with xml over the years, and now having a
discussion if something is allowed or not, or good practice or not.
It's about repeating a tag within a tag that contains also other things.
an example to make it clear:

<basicFlightInfo>
<flightDetails>
<departureDate>011008</departureDate>
<departureTime>0834</departureTime>
</flightDetails>
<departureLocation>
<cityAirport>ZWE</cityAirport>
</departureLocation>
<productTypeDetail>D</productTypeDetail>
<productTypeDetail>702</productTypeDetail>
<productTypeDetail>ET</productTypeDetail>
</basicFlightInfo>

Is it allowed to repeat the <productTypeDetail> ?
Would it be better to nest it in another tag, like :
<details>
<productTypeDetail>D</productTypeDetail>
<productTypeDetail>702</productTypeDetail>
<productTypeDetail>ET</productTypeDetail>
</details>

Or is it necessary to do so ?

thanks for advice !

Guido

 
Reply With Quote
 
 
 
 
Pavel Lepin
Guest
Posts: n/a
 
      07-25-2008

Gieke <(E-Mail Removed)> wrote in
<4888983e$0$1604$(E-Mail Removed). net>:
> It's about repeating a tag within a tag that contains also
> other things. an example to make it clear:
>
> <basicFlightInfo>
> <flightDetails>
> <departureDate>011008</departureDate>
> <departureTime>0834</departureTime>
> </flightDetails>
> <departureLocation>
> <cityAirport>ZWE</cityAirport>
> </departureLocation>
> <productTypeDetail>D</productTypeDetail>
> <productTypeDetail>702</productTypeDetail>
> <productTypeDetail>ET</productTypeDetail>
> </basicFlightInfo>
>
> Is it allowed to repeat the <productTypeDetail> ?


It is definitely allowed.

> Would it be better to nest it in another tag, like :
> <details>
> <productTypeDetail>D</productTypeDetail>
> <productTypeDetail>702</productTypeDetail>
> <productTypeDetail>ET</productTypeDetail>
> </details>
>
> Or is it necessary to do so ?


This is by no means necessary, but a good practice in my
opinion. Well-structured documents are much easier to
process.

--
Waterfall - One Process To Rule Them All
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a Good Sim to Practice on and a good book? Pat MCSA 2 03-29-2008 12:19 AM
Is this good code? Good practice advice needed... SM HTML 9 11-12-2007 03:39 AM
good algorithms come with practice and reading good code/books? vlsidesign C Programming 26 01-02-2007 09:50 AM
Remember when your piano teacher taught you, "Practice, practice,practice ...?" Wayne Wastier Windows 64bit 3 06-10-2005 08:29 PM
Good practice for signal types Alex Young VHDL 3 10-12-2004 08:40 AM



Advertisments