dynamic naming for hierarchical problem

Peter Hansen peter at engcorp.com
Sat Aug 11 23:35:01 EDT 2001


Erik Max Francis wrote:
> 
> Peter Hansen wrote:
> > <myproblem:recordset>
> >   <record>0 0 0 0 0</record>
> >   <record>0 0 0 0 0</record>
> >   <record>0 0 0 0 0</record>
> >   <record>0 0 0 0</record>
> >   <record>0 0 0 0</record>
> > </myproblem:recordset>
> 
> This wouldn't be a reasonable solution if, say, each of those
> subelements (a through e) are optional, which it appears might be the
> case (since in the last two lines it is d that is missing, not e).

True, but there is a probably a less verbose alternative
than the original even for that case.  (My point was really
that you don't need to slavishly break the data down into
tiny little pieces, each with a verbose XML tag pair
surrounding it, if that doesn't buy you anything.)

I was assuming, however, that the choice to drop "d"
instead of "e" was merely incidental, not intentional.

-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list