Aside from the various guesses at how to push data onto the SOURCEFIELD
array (only Gyepi and Jeffrey have it right :) I advise you to look at
XML::Writer for XML output, instead of XML::Simple.  XML::Simple might
be good for a first pass at generating output, but you'll almost
certainly come to want tighter control over how it handles arrays vs.
single items and attributes vs. elements.  XML::Writer is a lot nicer in
this respect.


 -- Jeremy


On Fri, 2004-07-16 at 08:26, William Goedicke wrote:
> Dear Y'all - 
> 
> I've been struggling with the following problem.  I've got a data
> structure that Dumper displays as:
> 
> $VAR1 = {
>     'TARGETTABLE' => {
>         'SOURCETABLE' => [
>             {
>               'ID' => 'S1',
>               'NAME' => 'PS_DIVERSITY',
>               'SOURCEFIELD' => [],
>               'DBID' => 'SDB1'
>             }
>              ],
>         'ID' => 'T1',
>         'NAME' => 'SDM_PERSON_DIM',
>         'DBID' => 'TDB1'
>          }
>   };
> 
> I need to push the following onto the SOURCEFIELD array:
> 
>    {
>     'NAME'=>$results[0],
>     'ID'=>$id, 
>     'TYPE'=>$results[1],
>     'TARGETFIELD'=>$id+100000
>    };
> 
> And, pure and simple, I can't get the syntax right.
> 
> One other thing, the goal of this code is to create an XML file
> that matches a given DTD, so as long as I want to continue using
> XML::Simple (which I really would prefer) I'm stuck with the data
> structure because it creates *exactly* the XML I need.
> 
> TIA
> 
>   Yours -   Billy
> 
> ============================================================
>   William Goedicke  [EMAIL PROTECTED]   
>   Cell 617-510-7244 http://www.goedsole.com:8080   
> ============================================================
> 
>     Lest we forget:
> 
> Politically I sit in that middle ground between Fidel Castro
> and the hardcore anarchists.
> 
>               - William Goedicke
> _______________________________________________
> Boston-pm mailing list
> [EMAIL PROTECTED]
> http://mail.pm.org/mailman/listinfo/boston-pm

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to