- 论坛徽章:
- 0
|
本帖最后由 shahuala 于 2012-04-18 10:46 编辑
有个模块xml::simple是解析xml文件的,但是我现在要通过url得到xml文件,不知道怎么得到。用lwp::simple的get()的话我试过了是得到html格式的,和xml文件格式不符的,我的xml网页的源码是类似这种的:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="resources/xsl/ValidateInternals.xsl"?>
<ValidateInternals host="phx7b02c-15ava46zf8s/10.86.92.178" client-ip="10.254.68.12" xmlns si="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="resources/xsd/ValidateInternals.xsd" more-info="HeaderPH"><HeaderPH value=" ool name: offer-app"></HeaderPH><HeaderConfig name="Configuration" desc="Configuration" href="ViewConfigCategoryList"></HeaderConfig><HeaderConfig name="ComponentStatus" desc="Component Status" href="ComponentStatusList"></HeaderConfig><HeaderConfig name=" artnerContingency" desc=" artner Contingency" href=" artnerContingency"></HeaderConfig><HeaderConfig name="ServiceClientStatus" desc="Service Client Status" href="ValidateInternals?component=serviceclientstatus"></HeaderConfig><HeaderConfig name="V4MonitoringHub" desc=" resentation" href="V4MonitoringHub"></HeaderConfig><HeaderConfig name="BusinessEventsConsole" desc="Business Events Console" href="BESConsole"></HeaderConfig><HeaderConfig name="NioAsyncSvcClientStatus" desc="NIO Service Client Status" href="ValidateInternals?component=NioAsyncSvcClientStatus"></HeaderConfig><Logs><![CDATA[http://logs.ebay.com/swat/file?r ... c%24%5cv3app%5Ccore]]> isProd="true"</Logs><CAL><![CDATA[http://10.2.179.17/cgi/logview?p ... tratus.phx.ebay.com]]></CAL><Component name=" ersistedDataSources" alias="persisteddatasources" status="Created">< ersistedDataSources><Source><![CDATA[c:\ebayconfig\dsc\core\dsimport.xml (2012-04-13_16:30:2 , DscInfo: version=55, checksum=56078, created=2012-04-13_16:20:15, modified=2012-04-13_16:20:15, dbenv=prod, deplslot=CORE, dnsregion=PHX, pool=v3offer, hwtype=, host=phx7b02c-15ava46zf8s]]></Source>< ersistedConnPoolConfig><Name><![CDATA[CORE_acc]]></Name><User><![CDATA[misc2_app]]></User><URL><![CDATA[jdbc racle:thin misc2.vip.ebay.com:1521:MISC2]]></URL><MinPoolSize>0</MinPoolSize><MaxPoolSize>6</MaxPoolSize><ConnectionTimeout>1</ConnectionTimeout><IdleTimeout>600</IdleTimeout><OrphanTimeout>30</OrphanTimeout><MaxStmtCacheSize>83</MaxStmtCacheSize><IdleStmtTimeout>620</IdleStmtTimeout><AutoFlushType>Default</AutoFlushType><ConnRateThrottle>0</ConnRateThrottle><DriverType>sql</DriverType><ConnectionProperties><!
我把它保存为.xml文件后还是不能解析出来,但是如果是这样的
<opt>
<user login="grep" fullname="Gary R Epstein" />
<user login="stty" fullname="Simon T Tyson" >
<session pid="12345"/>
</user>
<text>This is a test.</text>
</opt>
就可以解析为哈希,请教各位大侠了 |
|