I'm constructing a UI via WxWidgets and will be using an XML file for the configuration allowing it to be modified outside of my perl code. My question is how can I determine the number of buttons needed for creation based on the layout of my XML code below?
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.0.0">
<name>TEST</name>
<notebook_tabs>
<tab index="1">Create
<button
internal_name="test1"
parent="-1"
text="button 1"
x_coordinate="5"
y_coordinate="5"
x_size="-1"
y_size="-1"
evt_1="EVT_BUTTON"
evt_1_function="testclick" />
<button
internal_name="test2"
parent="-1"
text="button 2"
x_coordinate="50"
y_coordinate="50"
x_size="-1"
y_size="-1"
evt_1="EVT_BUTTON"
evt_1_function="testclick2" />
</tab>
<tab index="2">Assign</tab>
</notebook_tabs>
</install>
Below is my test code...I'm able to retrieve the tabs data but can't seem to determine the number of buttons and the params for each.
use strict;
use warnings;
use XML::Simple;
my $config = XMLin('C:\path\tp\test.xml');
use Data::Dumper;
#print Dumper($config);
my @tabs = $config->{notebook_tabs};
print Dumper(@tabs);
Any help or suggestions would be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.