comp.text.xml
[Top] [All Lists]

is this good practice ?

Subject: is this good practice ?
From: "Gieke"
Date: Thu, 24 Jul 2008 17:02:06 +0200
Newsgroups: comp.text.xml


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

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy