Hallo. kennt jemand ein klasse um ein pad-datei zu parsen?
Danke!
Danke!
<?xml version="1.0" encoding="UTF-8"?>
<XML_DIZ_INFO>
<MASTER_PAD_VERSION_INFO>
<MASTER_PAD_VERSION>2.01</MASTER_PAD_VERSION>
<MASTER_PAD_EDITOR>DeuPAD 2.0.0.47 ([url]http://www.deupad.org[/url])</MASTER_PAD_EDITOR>
<MASTER_PAD_INFO>Portable Application Description, or PAD for short, is a data set that is used by shareware authors to dissemminate information to anyone interested in their software products. To find out more go to [url]http://www.asp-shareware.org/pad[/url]</MASTER_PAD_INFO>
</MASTER_PAD_VERSION_INFO>
<Company_Info>
<Company_Name />
<Address_1 />
<Address_2 />
<Zip_Postal_Code />
<City_Town />
<Country />
<State_Province />
<Company_WebSite_URL />
<Contact_Info>
<Author_First_Name />
<Author_Last_Name />
<Author_Email />
<Contact_First_Name />
<Contact_Last_Name />
<Contact_Email />
</Contact_Info>
<Support_Info>
<General_Email />
<Support_Email />
<Sales_Email />
<General_Phone />
<Support_Phone />
<Sales_Phone />
<Fax_Phone />
</Support_Info>
</Company_Info>
<Program_Info>
<Program_Name />
<Program_Version />
<Program_Type />
<Program_Release_Status />
<Program_Category_Class />
<Program_Release_Year />
<Program_Release_Month />
<Program_Release_Day />
<Program_Cost_Other>0.00</Program_Cost_Other>
<Program_Cost_Other_Code />
<Program_Cost_Dollars>0.00</Program_Cost_Dollars>
<Program_Categories />
<Program_Specific_Category />
<Program_Change_Info />
<Program_Language />
<Program_OS_Support />
<Program_Install_Support />
<Program_System_Requirements />
<Includes_VB_Runtime>N</Includes_VB_Runtime>
<Includes_JAVA_VM>N</Includes_JAVA_VM>
<Includes_DirectX>N</Includes_DirectX>
<File_Info>
<Filename_Long />
<Filename_Generic />
<Filename_Versioned />
<Filename_Previous />
<File_Size_Bytes />
<File_Size_K>1</File_Size_K>
<File_Size_MB>0.01</File_Size_MB>
</File_Info>
<Expire_Info>
<Has_Expire_Info>N</Has_Expire_Info>
<Expire_Based_On />
<Expire_Count>0</Expire_Count>
<Expire_Other_Info />
<Expire_Year />
<Expire_Month />
<Expire_Day />
</Expire_Info>
</Program_Info>
<Program_Descriptions>
<German>
<Keywords />
<Char_Desc_45 />
<Char_Desc_80 />
<Char_Desc_250 />
<Char_Desc_450 />
<Char_Desc_2000 />
</German>
<English>
<Keywords />
<Char_Desc_45 />
<Char_Desc_80 />
<Char_Desc_250 />
<Char_Desc_450 />
<Char_Desc_2000 />
</English>
</Program_Descriptions>
<Web_Info>
<Application_URLs>
<Application_Info_URL />
<Application_Order_URL />
<Application_Screenshot_URL />
<Application_Icon_URL />
<Application_XML_File_URL />
</Application_URLs>
<Download_URLs>
<Primary_Download_URL />
<Secondary_Download_URL />
<Additional_Download_URL_1 />
<Additional_Download_URL_2 />
</Download_URLs>
</Web_Info>
<Permissions>
<Distribution_Permissions />
<EULA />
</Permissions>
<DeuPAD>
<DeuPAD_Extension_Version>2.00</DeuPAD_Extension_Version>
<DeuPAD_Extension_Info>For information on the DeuPAD Extensions please go to [url]http://www.deupad.org[/url]</DeuPAD_Extension_Info>
<SAVE_Member>N</SAVE_Member>
<SAVE_Member_Number />
<Company_Unique_ID />
<Save_Prog_Num />
<Program_Unique_ID />
<Program_Cost_EUR>0.00</Program_Cost_EUR>
<Program_Categories_German />
<Program_System_Requirements_German />
<Expire_Other_Info_German />
<EULA_German />
<Program_Change_Info_German />
</DeuPAD>
<Affiliates>
<Affiliates_FORM>Y</Affiliates_FORM>
<Affiliates_VERSION>1.0</Affiliates_VERSION>
<Affiliates_URL>[url]http://www.asp-shareware.org/pad/extensions/Affiliates.htm[/url]</Affiliates_URL>
<Affiliates_Information_Page />
<Affiliates_BMTMicro_Order_Page />
<Affiliates_BMTMicro_Vendor_ID />
<Affiliates_BMTMicro_Product_ID />
<Affiliates_BMTMicro_Maximum_Commission_Rate />
<Affiliates_DigiBuy_Order_Page />
<Affiliates_DigiBuy_Vendor_ID />
<Affiliates_DigiBuy_Product_ID />
<Affiliates_DigiBuy_Maximum_Commission_Rate />
<Affiliates_DigitalCandle_Order_Page />
<Affiliates_DigitalCandle_Vendor_ID />
<Affiliates_DigitalCandle_Product_ID />
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
<Affiliates_Emetrix_Order_Page />
<Affiliates_Emetrix_Vendor_ID />
<Affiliates_Emetrix_Product_ID />
<Affiliates_Emetrix_Maximum_Commission_Rate />
<Affiliates_eSellerate_Order_Page />
<Affiliates_eSellerate_Vendor_ID />
<Affiliates_eSellerate_Product_ID />
<Affiliates_eSellerate_Maximum_Commission_Rate />
<Affiliates_Kagi_Order_Page />
<Affiliates_Kagi_Vendor_ID />
<Affiliates_Kagi_Product_ID />
<Affiliates_Kagi_Maximum_Commission_Rate />
<Affiliates_NorthStarSol_Order_Page />
<Affiliates_NorthStarSol_Vendor_ID />
<Affiliates_NorthStarSol_Product_ID />
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
<Affiliates_Order1_Order_Page />
<Affiliates_Order1_Vendor_ID />
<Affiliates_Order1_Product_ID />
<Affiliates_Order1_Maximum_Commission_Rate />
<Affiliates_Osolis_Order_Page />
<Affiliates_Osolis_Vendor_ID />
<Affiliates_Osolis_Product_ID />
<Affiliates_Osolis_Maximum_Commission_Rate />
<Affiliates_Regnet_Order_Page />
<Affiliates_Regnet_Vendor_ID />
<Affiliates_Regnet_Product_ID />
<Affiliates_Regnet_Maximum_Commission_Rate />
<Affiliates_Regnow_Order_Page />
<Affiliates_Regnow_Vendor_ID />
<Affiliates_Regnow_Product_ID />
<Affiliates_Regnow_Maximum_Commission_Rate />
<Affiliates_Regsoft_Order_Page />
<Affiliates_Regsoft_Vendor_ID />
<Affiliates_Regsoft_Product_ID />
<Affiliates_Regsoft_Maximum_Commission_Rate />
<Affiliates_ShareIt_Order_Page />
<Affiliates_ShareIt_Vendor_ID />
<Affiliates_ShareIt_Product_ID />
<Affiliates_ShareIt_Maximum_Commission_Rate />
<Affiliates_SWReg_Order_Page />
<Affiliates_SWReg_Vendor_ID />
<Affiliates_SWReg_Product_ID />
<Affiliates_SWReg_Maximum_Commission_Rate />
<Affiliates_V-Share_Order_Page />
<Affiliates_V-Share_Vendor_ID />
<Affiliates_V-Share_Product_ID />
<Affiliates_V-Share_Maximum_Commission_Rate />
<Affiliates_VFree_Order_Page />
<Affiliates_VFree_Vendor_ID />
<Affiliates_VFree_Product_ID />
<Affiliates_VFree_Maximum_Commission_Rate />
<Affiliates_Yaskifo_Order_Page />
<Affiliates_Yaskifo_Vendor_ID />
<Affiliates_Yaskifo_Product_ID />
<Affiliates_Yaskifo_Maximum_Commission_Rate />
</Affiliates>
<ASP>
<ASP_FORM>Y</ASP_FORM>
<ASP_Member>N</ASP_Member>
<ASP_Member_Number />
</ASP>
</XML_DIZ_INFO>
function xml2php($file) {
$xml_parser = xml_parser_create();
if (!($fp = fopen($file, "r"))) {
die("unable to open XML");
}
$contents = fread($fp, filesize($file));
fclose($fp);
xml_parse_into_struct($xml_parser, $contents, $arr_vals);
xml_parser_free($xml_parser);
return $arr_vals;
}
Kommentar