Re: Using XML::Simple [SORRY - correction]

2006-01-19 Thread John Doe
John Doe am Donnerstag, 19. Januar 2006 12.43:

 $VAR1-{LayerList}-{LayerDetails}=
[ map {%$_} @{$VAR1-{LayerList}-{LayerDetails}} ];

This should be:

$VAR1-{LayerList}-{LayerDetails}=
  [ map {values %$_} @{$VAR1-{LayerList}-{LayerDetails}} ];

(The 'values' omits the repeated 'Name' in the result)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Using XML::Simple

2006-01-19 Thread Bjorn Van Blanckenberg

I had to use an combination of GroupTags and then ValueAttr

my $ref = XMLin($jdf,GroupTags = { LayerList = 'LayerDetails' },  
ValueAttr = [ LayerList = 'Name' ] );


thanks

On 19-jan-06, at 12:43, John Doe wrote:


Bjorn Van Blanckenberg am Donnerstag, 19. Januar 2006 09.33:

I have some elements in my xml that are empty but have attributes.
I would like that I can group the element in function of Attribute  
Name.


   Layout Class=Parameter ID=r060116_103344354_26
Status=Available
 LayerList
   LayerDetails Name=nl-BE/
   LayerDetails Name=fr-BE/
   LayerDetails Name=nl-NL/
 /LayerList
   /Layout

I read in I get

$VAR1 = {
   'ID' = 'r060116_103344354_26',
   'Status' = 'Available',
   'LayerList' = {
'LayerDetails' = [
{
  'Name' = 'nl-BE'
},
{
  'Name' = 'fr-BE'
},
{
  'Name' = 'nl-NL'
}
  ]
  },
   'Class' = 'Parameter'
 };


I would like it when the xml is readed in to became

{
'ID' = 'r060116_103344354_26',
 'Status' = 'Available',
'LayerList' = {
'LayerDetails' = [ 'nl-BE', 'fr-BE',  
'nl-

NL' ]
},
'Class' = 'Parameter'
}
  }

I've tried to use
# KeyAttr = [ list ]
# KeyAttr = { list }
# GroupTags = { grouping tag = grouped tag }

even an combination of KeyAttri and GroupTags but don't get the
desired output


Just in case it's not possible with XML::Simple, you could use a  
workaround on

the result data structure by transforming it with:

$VAR1-{LayerList}-{LayerDetails}=
   [ map {%$_} @{$VAR1-{LayerList}-{LayerDetails}} ];

hth, joe


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Using XML::Simple

2006-01-19 Thread RangerRickCA
Please remove me from this list!  Thank you!
 
RRCA


Re: Using XML::Simple

2006-01-19 Thread RangerRickCA
 
Please remove me from this list!  Thank you!
 
RRCA



Re: Using XML::Simple [SORRY - correction]

2006-01-19 Thread RangerRickCA
 
Please remove me from this list!  Thank you!
 
RRCA



RE: Using XML::Simple

2006-01-19 Thread Michael . Coll-Barth

Well, I just gave this email address to a SPAM list


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 19, 2006 12:59 PM
To: [EMAIL PROTECTED]; beginners@perl.org
Subject: Re: Using XML::Simple


Please remove me from this list!  Thank you!
 
RRCA


The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Using XML::Simple [SORRY - correction]

2006-01-19 Thread John Meyer
[EMAIL PROTECTED] wrote:
  
 Please remove me from this list!  Thank you!
  
 RRCA
 
 

Kindly remove yourself from this list and refrain from showing the rest
of us how much of an idiot you are.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response