- 论坛徽章:
- 0
|
谢谢回复!
下面这个是示例的代码,运行的时候就会出错,不知道怎么办好。- #!/usr/bin/perl
- use 5.014;
- use XML::XPath;
- use XML::XPath::XMLParser;
- $/ = undef;
- my $xp = XML::XPath->new( xml => <DATA>);
- say $xp->getNodeText('XML_DIZ_INFO/Company_Info/Company_Name');
- __DATA__
- <?xml version="1.0" encoding="Windows-1254" ?>
- <XML_DIZ_INFO>
- <Company_Info>
- <Company_Name>Absolutist.com</Company_Name>
- <Address_1>16 Kyriakos Matsis Ave, 10th Floor</Address_1>
- <Address_2 />
- <City_Town>Nicosia</City_Town>
- <State_Province />
- <Zip_Postal_Code>1509</Zip_Postal_Code>
- <Country>Cyprus</Country>
- <Company_WebSite_URL>http://absolutist.com/</Company_WebSite_URL>
- </Company_Info>
- </XML_DIZ_INFO>
复制代码 |
|