Problem with XML_Serializer
| From: | John Malone | Date: | Wed, 26 Oct 2005 20:36:19 +0000 |
| Subject: | Problem with XML_Serializer | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21652@lists.php.net to get a copy of this message | ||
I'm kind of new to this XML stuff, and I've been trying to implement the XML
Serializer to unserialize a toolbar configuration like the following:
<?xml version="1.0" encoding="utf-8"?>
<TOOLBAR icons="nav.bmp" hot_icons="nav.bmp" name="Google Toolbar"
dllname="google_toolbar" id="tbs_toolbar_007370">
<BUTTON caption="" hint="My Logo" id="tb_btn_vFSMgLLx"
img=""
command="redirect" href="http://www.google.com">
<MENU type="Split" img="demo_logo.bmp" hotimg="demo_logo.bmp"
id="tbs_menu_011299">
<ITEM caption="Google Home Page" hint="Navigate to the Google home page"
img="" href="http://www.google.com"
command="redirect"
id="tbs_item_011508"/>
<ITEM caption="Google Links" hint="" img=""
id="tbs_item_016659">
</MENU>
</BUTTON>
<SEPARATOR id="tbs_separator_000555"/>
<COMBO name="search" caption="" hint="Search Google"
limit="40" histmax="10"
id="tb_cmb_SVCgVyWG" command="keMdXGRo" dwidth="130"
kind="editable">
</COMBO>
<BUTTON caption="Search Web" hint="Search the Web"
id="tb_btn_LKRIuoCj"
img="93" command="OGFnfNCz">
<MENU type="Split" img="" hotimg=""
id="tbs_menu_019589">
<ITEM caption="Search Web" hint="" img=""
command="pXyPVctx"
id="tbs_item_003161"/>
</MENU>
</BUTTON>
</TOOLBAR>
The problem I am running into is that the order of the elements is important
to me, because this format determines how my toolbar will look. When I run
it through the unserializer, each button gets put into button[] and each
combo gets put into combo[] and my order is lost. What I'm looking to do is
have the elements brought into a toolbar[] and then I can check if button[]
is set for toolbar[0] or if combo is set for toolbar[0].
Any suggestions?
Thank you in advance,
John