onsfile_get_contents

file_get_contents  时间:2021-05-19  阅读:()
CopyrightIBMCorporation2010TrademarksSimulateXQueryandXIncludefunctionalitywithPHPPage1of8SimulateXQueryandXIncludefunctionalitywithPHPEnjoythepowerofXMLdataprocessinginwebprogrammingColinBeckinghamSeptember21,2010ManybrowserscanhandleXMLingeneral,butarecurrentlyweakintheirsupportofXQueryandXInclude.
YouneedtoworkaroundthisissuewhenyoubuildwebapplicationsthatcombineandprocessXML-structureddatafrommultiplesources.
UsingPHPisonesolution.
ThisarticlefirstshowshowyourwebpagescandeliverdataextractsfromXMLusingXQueryandXIncludeexplicitly,andthenhowtodotheequivalentworkwithPHP,allwithinthecontextofacooperativeeffortamonggardencenters.
XIncludeandXQueryareXMLtoolsthathelpwebprogrammersprocessdatadynamically.
XIncludeletsyoutreatmultipleXMLfilesasiftheywereonefile,andXQuerycanprocessthecombineddataandprepareitforinclusionintooutputforweb-pagedisplay.
Together,theyperformthisserviceelegantlyandefficientlywithfewlinesofcode.
FrequentlyusedacronymsHTTP:HypertextTransferProtocolW3C:WorldWideWebConsortiumXHTML:ExtensibleHypertextMarkupLanguageXML:ExtensibleMarkupLanguageXSL:ExtensibleStylesheetLanguageMostbrowserscandisplayandprocessXMLfileseitherdirectlyorincooperationwithXSLtemplates.
Inanidealworld,browserswouldunderstandXQueryandXIncludedirectlytoo.
Butatthispointtheysupportthesetoolsonlybyplacingunreasonabledemandsonusers—forexample,byrequiringthemtoloadexperimentaladd-ons.
Fetchingthedatafromwidelydifferentsourcesandcombiningthemintoonelargedatasetforprocessingcanbeapainstakingtaskforthewebprogrammer.
Throughahypotheticalbusinessexample,thisarticlefirstshowsyouthestrengthofthecombinationofXQueryandXInclude.
Thenyou'lllearnhowtousePHPtosimulatethefunctionalitythatXQueryandXIncludeprovide.
MovingallthedataprocessingtotheserversidegivesyouaworkaroundtolimitedbrowsersupportforXQueryandXInclude.
AnotherbenefitisthatPHPgivesyoumuchfinercontroloverthefinaloutputpresentation.
developerWorksibm.
com/developerWorks/SimulateXQueryandXIncludefunctionalitywithPHPPage2of8Example:Garden-centercooperationImaginethatatownhasthreegardencenters.
Theycompetewithoneanotherbutprovidesufficientlydifferentservicesthattheycandosocooperativelyratherthanantagonistically.
Theydosomemarketresearchtogetfindouthowtheircustomersbuytheirplants.
Inthehorticulturebusiness,salesofhighlyperishableproductsoccurinhighvolumeinashortperiodoftime,andcustomerscanbequiteparticularaboutthetypeandqualityofproductstheywant.
Itisinthebestinterestofthebusinesstogetthehigh-maintenanceproducts(forexample,thosethatneedtobewateredandkeptfreeofpests)outthedoorassoonaspossibleandtokeepamercurialcustomerbasehappybyprovidingthemwiththerightproductsattherighttimeandintherightplace.
Otherwisecustomersflocktothecompetitionthatcan.
Researchshowsthatcustomersdonotlikephoningaroundtofindwheretheycangettheirplants,andthehighvolumeofcallsisinconvenienttothebusinessesaswell.
Atthebeginningoftheseason,allthebusinesseshaveplentyofproduct.
Laterintheseason,despitegoodplanning,productstartstorunoutunevenly.
Customerslookingforpetuniasmighthavetophoneorvisitallthreegardencentersbeforetheyfindthehotpinkcolorthey'relookingfor.
Ingeneral,customerswanttoknowwhohaswhichplant,inwhatsizepot,inwhatquantity,andatwhatprice.
TheproposedsetupThethreeITmanagersholdameeting.
Theydecidetocreateacommonwebsitewherecustomerscanfindoutwhichgardencenterhasspecificplantsinstock.
Althoughallthreegardencentersarecomputerized,eachusesadifferentsystemtostoreinformation.
ApplesandThingsusesaMicrosoftAccessdatabasesystem,BirchTreesUnlimitedusesaLinuxsystemwithMySQL,andCarnationTarnationusesMacOSXwithIBMDB2.
Broadly,theydecidetoworktowardanXML-basedarchitecture.
XMLisaconvenientdataformatbecauseeachoftheirsystemscanexportcurrentdatatoanXMLfilethatisavailableinthecloud.
AmasterXMLfilecollectstheindividualstores'dataintoonecentralplace,usingXInclude.
Finally,themainwebpageexaminesthemasterfile,extractsthedatausingXQuery,andrendersthefinaldisplay.
ProcessingtheXMLwithXIncludeandXQueryTheITmanagersdecidethateachstorewillproduceanXMLfilesimilartotheoneinListing1:Listing1.
StoreXMLfile.
.
.
.
.
.
.
.
.
ibm.
com/developerWorks/developerWorksSimulateXQueryandXIncludefunctionalitywithPHPPage3of8PetuniaPink,in4inchpots1003.
00Appletree'Spartan'625.
00.
.
.
Thisfilehasastorerootelementandtwochildelements.
Theinfochildelementcontainsinformationaboutthestoreingeneral.
Theplantschildelementcontainsmanyplantchildelements,eachofwhichcontainsfurtherinformationaboutthatplant,includingthename,description,quantityandprice.
Allthreestoresfollowthispatternexactly.
Listing2istheirversionofamainXMLfilethatcombinesallthreestorefilessotheyappeartobeonelargefile,maintainingdetailsabouttheproducts:Listing2.
MainXMLfileInListing2,XIncludeisusedtofetchdatafromthethreelocationsusingHTTPinthecloud.
Afterprocessing,itlookslikeListing3:Listing3.
MainXMLfileexpandedApples.
.
.
.
.
.
Birches.
.
.
.
.
.
.
.
.
developerWorksibm.
com/developerWorks/SimulateXQueryandXIncludefunctionalitywithPHPPage4of8InListing3,theincludeinstructionsfromListing2arereplacedbythecontentsoftheindividualstoreXMLfiles.
EachstoreelementisnowachildelementoftheglobalstoreDataelement.
YoucannowapplyXQuerytothecombineddataset,asinListing4:Listing4.
ApplyingXQuery{for$storeindoc("mainXMLfile.
xml")/storeData/storelet$plants:=$store/plants/plantreturn{for$plantin$plantsorderby$plant/namereturn{concat($plant/quantity,"of",$plant/name,"at",$store/info/name,"for",$plant/price,"each")}

VoLLcloud:超便宜香港CMI大带宽vps-三网CMI直连-年付四免服务-低至4刀/月-奈飞

vollcloud LLC创立于2020年,是一家以互联网基础业务服务为主的 技术型企业,运营全球数据中心业务。致力于全球服务器租用、托管及云计算、DDOS安 全防护、数据实时存储、 高防服务器加速、域名、智能高防服务器、网络安全服务解决方案等领域的智 能化、规范化的体验服务。所有购买年付产品免费更换香港原生IP(支持解锁奈飞),商家承诺,支持3天内无条件退款(原路退回)!点击进入:vollclo...

GigsGigsCloud 春节优惠2022 指定云服务器VPS主机85折循环优惠码

GigsGigsCloud商家在之前介绍的还是比较多的,因为之前我一直有几台机器在使用,只是最近几年网站都陆续转型删除掉不少的网站和闲置域名,包括今年也都减少网站开始转型自媒体方向。GigsGigsCloud 商家产品还是比较有特色的,有提供香港、新加坡等亚洲机房的云服务器、VPS和独立服务器等。第一、新春优惠活动优惠码:CNY2022-15OFF截止到正月初二,我们可以使用上述优惠码在购买指定G...

ZJI:香港物理服务器,2*E5-2630L/32G/480G SSD/30Mbps/2IP/香港BGP,月付520元

zji怎么样?zji是一家老牌国人主机商家,公司开办在香港,这个平台主要销售独立服务器业务,和hostkvm是同一样,两个平台销售的产品类别不一平,商家的技术非常不错,机器非常稳定。昨天收到商家的优惠推送,目前针对香港邦联四型推出了65折优惠BGP线路服务器,性价比非常不错,有需要香港独立服务器的朋友可以入手,非常适合做站。zji优惠码:月付/年付优惠码:zji 物理服务器/VDS/虚拟主机空间订...

file_get_contents为你推荐
安装morphvoxwindows键是哪个windows 快捷键 大全ipadwifiipad的wifi打不开怎么办?iphonewifi苹果手机突然用不了Wi-Fi了googleadsense·什么是Google AdSense?如何加入Google AdSense? 谁可以告诉我吗?css选择器请给出三种Css选择器并举例说明苹果5.1完美越狱ios5.1能不能完美越狱?fastreport2.5护套线BV2.5中的2.5是指什么尺寸,单位是什么,BV又是什么意思?ios5.1.1固件下载关于iphone4s 现在的系统是ios5.1.1,可以直接升级到系统ios6.1?winrar5.0winrar压缩3种格式分别有什么区别
企业虚拟主机 二级域名 免费动态域名解析 budgetvm 韩国俄罗斯 Vultr cve-2014-6271 52测评网 帽子云 谁的qq空间最好看 免费网页空间 1元域名 韩国代理ip lamp的音标 学生服务器 服务器托管价格 godaddy中文 nic asp简介 超低价 更多