编写者 | 日期 | 关键词 |
郑昀@ultrapower | 2005-9-20 | WBXML XML Perl |
利用Perl库XML::WBXML,
就可以执行XML和WBXML(Wap Binary XML)之间的自由转换了:
use XML::WBXML;
$wbxml = XML::WBXML::xml_to_wbxml($xml);
$xml = XML::WBXML::wbxml_to_xml($wbxml);
下面我说一下如何编译这个包。
http://libwbxml.aymerick.com/download.phpAymerick Jehanne用C++DLLWBXML Library v0.9.0 (download)
http://search.cpan.org/dist/XML-WBXML/lib/XML/WBXML.pm
下载
Perllibwbxml2.dll
XML-WBXMLXML-WBXML-0.02.tar.gzMakefile.pllinklibmake
正在创建库 blib/arch/auto/XML/WBXML/WBXML.lib 和对象 blib/arch/auto/XML/WBXML/WBXML.exp WBXML.obj : error LNK2019: 无法解析的外部符号 _wbxml_conv_xml2wbxml@16 ,该符号 在函数 _XS_XML__WBXML_xml_to_wbxml 中被引用 WBXML.obj : error LNK2019: 无法解析的外部符号 _wbxml_conv_wbxml2xml@16 ,该符号 在函数 _XS_XML__WBXML_wbxml_to_xml 中被引用 blib/arch/auto/XML/WBXML/WBXML.dll : fatal error LNK1120: 2 个无法解析的外部命令
NMAKE : fatal error U1077: “link” : 返回代码“0x460” |
MYEXTLIB => 'libwbxml2.lib'
Makefile.PL |
use 5.008003; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'XML::WBXML', VERSION_FROM => 'lib/XML/WBXML.pm', # finds $VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ABSTRACT_FROM => 'lib/XML/WBXML.pm', # retrieve abstract from module AUTHOR => 'David Glasser ', LIBS => ['-lwbxml2'], # e.g., '-lm' DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I.', # e.g., '-I. -I/usr/include/other' # Un-comment this if you add C files to link with later: #add begin MYEXTLIB => 'libwbxml2.lib',
# OBJECT => '$(O_FILES)', # link all the C files too ); |
libwbxml2.lib,你必须编译WBXML Library v0.9.0libwbxml.hwbxml_parser.hPerl/lib/XMLwbxml
perlWBXML.DLLlibwbxml2.dlllibexpat.dllPerl/lib/XML/blib/arch/auto/XML/WBXML