perl 第乙個建立xml文件

2021-04-01 04:48:08 字數 1250 閱讀 8745

使用xml—writer

#!c:/perl/bin/

use xml::writer;

use io;

#open file stream .param is file name.

my $output = new io::file(">output.xml");

#new a output stream.

my $writer = new xml::writer(output => $output)

or die"create fail";

print "file create success!";

#seting xml encoding . version is 1.0.

$writer->xmldecl("gb2312");

#seting enter

$writer->setdataindent("/n");

#seting first class start tag

$writer->starttag("root");

#fill in /n

$writer->characters("/n");

#seting seconly class start tag

$writer->starttag("child");

#seting  third class start tag

$writer->dataelement("count","123");

$writer->dataelement("name","sss");

#seting seconly class end tag

$writer->endtag("child");

$writer->characters("/n");

$writer->starttag("child");

$writer->dataelement("count","123");

$writer->dataelement("name","sss");

$writer->endtag("child");

$writer->characters("/n");

#seting first class end tag

$writer->endtag("root");

#close writer stream

$writer->end();

#close output stream

$output->close();

perl 第乙個建立xml文件

使用xml writer c perl bin use xml writer use io open file stream param is file name.my output new io file output.xml new a output stream.my writer new x...

建立第乙個MVC

建立第乙個mvc asp.net 和預設路由設定 asp.net的mvc已經出到了4.0,我用的是visual studio2013,接下來努力學下mvc,學之前的話我建議大家先去學下三層 分別是dal bll model 大家可以去谷歌下,理解下這個理念,理解下各個層之間的關係,對mvc的學習也會...

第乙個hibernate程式(xml版本)

1.在使用hibernate3.3 的時候使用的包的配置情況 a.b color orange hibernate3.jar color b 這是hibernate的核心包。b.在lib資料夾中的required包中所用的jar包 img c.關於日誌的包,我們需要slf4j的日誌包,需要注意的是需...