亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? xmlparser.pm

?? 網(wǎng)頁(yè)留言本,比一般的留言簿管用
?? PM
字號(hào):
# $Id: XMLParser.pm 4532 2004-05-11 05:15:40Z ezra $package XML::XPath::XMLParser;use strict;use XML::Parser;#use XML::XPath;use XML::XPath::Node;use XML::XPath::Node::Element;use XML::XPath::Node::Text;use XML::XPath::Node::Comment;use XML::XPath::Node::PI;use XML::XPath::Node::Attribute;use XML::XPath::Node::Namespace;my @options = qw(        filename        xml        parser        ioref        );my ($_current, $_namespaces_on);my %IdNames;use vars qw/$xmlns_ns $xml_ns/;$xmlns_ns = "http://www.w3.org/2000/xmlns/";$xml_ns = "http://www.w3.org/XML/1998/namespace";sub new {    my $proto = shift;    my $class = ref($proto) || $proto;    my %args = @_;    my %hash = map(( "_$_" => $args{$_} ), @options);    bless \%hash, $class;}sub parse {    my $self = shift;        $self->{IdNames} = {};    $self->{InScopeNamespaceStack} = [ {             '_Default' => undef,            'xmlns' => $xmlns_ns,            'xml' => $xml_ns,        } ];        $self->{NodeStack} = [ ];        $self->set_xml($_[0]) if $_[0];        my $parser = $self->get_parser || XML::Parser->new(            ErrorContext => 2,            ParseParamEnt => 1,            );        $parser->setHandlers(            Init => sub { $self->parse_init(@_) },            Char => sub { $self->parse_char(@_) },            Start => sub { $self->parse_start(@_) },            End => sub { $self->parse_end(@_) },            Final => sub { $self->parse_final(@_) },            Proc => sub { $self->parse_pi(@_) },            Comment => sub { $self->parse_comment(@_) },            Attlist => sub { $self->parse_attlist(@_) },            );        my $toparse;    if ($toparse = $self->get_filename) {        return $parser->parsefile($toparse);    }    else {        return $parser->parse($self->get_xml || $self->get_ioref);    }}sub parsefile {    my $self = shift;    my ($filename) = @_;    $self->set_filename($filename);    $self->parse;}sub parse_init {    my $self = shift;    my $e = shift;    my $document = XML::XPath::Node::Element->new();    my $newns = XML::XPath::Node::Namespace->new('xml', $xml_ns);    $document->appendNamespace($newns);    $self->{current} = $self->{DOC_Node} = $document;}sub parse_final {    my $self = shift;    return $self->{DOC_Node};}sub parse_char {    my $self = shift;    my $e = shift;    my $text = shift;        my $parent = $self->{current};        my $last = $parent->getLastChild;    if ($last && $last->isTextNode) {        # append to previous text node        $last->appendText($text);        return;    }        my $node = XML::XPath::Node::Text->new($text);    $parent->appendChild($node, 1);}sub parse_start {    my $self = shift;    my $e = shift;    my $tag = shift;        push @{ $self->{InScopeNamespaceStack} },         { %{ $self->{InScopeNamespaceStack}[-1] } };    $self->_scan_namespaces(@_);        my ($prefix, $namespace) = $self->_namespace($tag);        my $node = XML::XPath::Node::Element->new($tag, $prefix);        my @attributes;    for (my $ii = 0; $ii < $#_; $ii += 2) {	my ($name, $value) = ($_[$ii], $_[$ii+1]);        if ($name =~ /^xmlns(:(.*))?$/) {            # namespace node            my $prefix = $2 || '#default';#            warn "Creating NS node: $prefix = $value\n";            my $newns = XML::XPath::Node::Namespace->new($prefix, $value);            $node->appendNamespace($newns);        }        else {	    my ($prefix, $namespace) = $self->_namespace($name);            undef $namespace unless $prefix;            my $newattr = XML::XPath::Node::Attribute->new($name, $value, $prefix);            $node->appendAttribute($newattr, 1);            if (exists($self->{IdNames}{$tag}) && ($self->{IdNames}{$tag} eq $name)) {    #            warn "appending Id Element: $val for ", $node->getName, "\n";                $self->{DOC_Node}->appendIdElement($value, $node);            }        }    }            $self->{current}->appendChild($node, 1);    $self->{current} = $node;}sub parse_end {    my $self = shift;    my $e = shift;    $self->{current} = $self->{current}->getParentNode;}sub parse_pi {    my $self = shift;    my $e = shift;    my ($target, $data) = @_;    my $node = XML::XPath::Node::PI->new($target, $data);    $self->{current}->appendChild($node, 1);}sub parse_comment {    my $self = shift;    my $e = shift;    my ($data) = @_;    my $node = XML::XPath::Node::Comment->new($data);    $self->{current}->appendChild($node, 1);}sub parse_attlist {    my $self = shift;    my $e = shift;    my ($elname, $attname, $type, $default, $fixed) = @_;    if ($type eq 'ID') {        $self->{IdNames}{$elname} = $attname;    }}sub _scan_namespaces {    my ($self, %attributes) = @_;    while (my ($attr_name, $value) = each %attributes) {	if ($attr_name eq 'xmlns') {	    $self->{InScopeNamespaceStack}[-1]{'_Default'} = $value;	} elsif ($attr_name =~ /^xmlns:(.*)$/) {	    my $prefix = $1;	    $self->{InScopeNamespaceStack}[-1]{$prefix} = $value;	}    }}sub _namespace {    my ($self, $name) = @_;    my ($prefix, $localname) = split(/:/, $name);    if (!defined($localname)) {	if ($prefix eq 'xmlns') {	    return '', undef;	} else {	    return '', $self->{InScopeNamespaceStack}[-1]{'_Default'};	}    } else {	return $prefix, $self->{InScopeNamespaceStack}[-1]{$prefix};    }}sub as_string {    my $node = shift;    $node->toString;}sub get_parser { shift->{_parser}; }sub get_filename { shift->{_filename}; }sub get_xml { shift->{_xml}; }sub get_ioref { shift->{_ioref}; }sub set_parser { $_[0]->{_parser} = $_[1]; }sub set_filename { $_[0]->{_filename} = $_[1]; }sub set_xml { $_[0]->{_xml} = $_[1]; }sub set_ioref { $_[0]->{_ioref} = $_[1]; }1;__END__=head1 NAMEXML::XPath::XMLParser - The default XML parsing class that produces a node tree=head1 SYNOPSIS    my $parser = XML::XPath::XMLParser->new(                filename => $self->get_filename,                xml => $self->get_xml,                ioref => $self->get_ioref,                parser => $self->get_parser,            );    my $root_node = $parser->parse;=head1 DESCRIPTIONThis module generates a node tree for use as the context node for XPath processing.It aims to be a quick parser, nothing fancy, and yet has to store more informationthan most parsers. To achieve this I've used array refs everywhere - no hashes.I don't have any performance figures for the speedups achieved, so I make noappologies for anyone not used to using arrays instead of hashes. I think theymake good sense here where we know the attributes of each type of node.=head1 Node StructureAll nodes have the same first 2 entries in the array: node_parentand node_pos. The type of the node is determined using the ref() function.The node_parent always contains an entry for the parent of the currentnode - except for the root node which has undef in there. And node_pos is theposition of this node in the array that it is in (think: $node == $node->[node_parent]->[node_children]->[$node->[node_pos]] )Nodes are structured as follows:=head2 Root NodeThe root node is just an element node with no parent.    [      undef, # node_parent - check for undef to identify root node      undef, # node_pos      undef, # node_prefix      [ ... ], # node_children (see below)    ]=head2 Element Node    [      $parent, # node_parent      <position in current array>, # node_pos      'xxx', # node_prefix - namespace prefix on this element      [ ... ], # node_children      'yyy', # node_name - element tag name      [ ... ], # node_attribs - attributes on this element      [ ... ], # node_namespaces - namespaces currently in scope    ]=head2 Attribute Node    [      $parent, # node_parent - the element node      <position in current array>, # node_pos      'xxx', # node_prefix - namespace prefix on this element      'href', # node_key - attribute name      'ftp://ftp.com/', # node_value - value in the node    ]=head2 Namespace NodesEach element has an associated set of namespace nodes that are currentlyin scope. Each namespace node stores a prefix and the expanded name (retrievedfrom the xmlns:prefix="..." attribute).    [      $parent,      <pos>,      'a', # node_prefix - the namespace as it was written as a prefix      'http://my.namespace.com', # node_expanded - the expanded name.    ]=head2 Text Nodes    [      $parent,      <pos>,      'This is some text' # node_text - the text in the node    ]=head2 Comment Nodes    [      $parent,      <pos>,      'This is a comment' # node_comment    ]=head2 Processing Instruction Nodes    [      $parent,      <pos>,      'target', # node_target      'data', # node_data    ]=head1 UsageIf you feel the need to use this module outside of XML::XPath (for exampleyou might use this module directly so that you can cache parsed trees), youcan follow the following API:=head2 newThe new method takes either no parameters, or any of the following parameters:        filename        xml        parser        iorefThis uses the familiar hash syntax, so an example might be:    use XML::XPath::XMLParser;        my $parser = XML::XPath::XMLParser->new(filename => 'example.xml');The parameters represent a filename, a string containing XML, an XML::Parserinstance and an open filehandle ref respectively. You can also set or get allof these properties using the get_ and set_ functions that have the samename as the property: e.g. get_filename, set_ioref, etc.=head2 parseThe parse method generally takes no parameters, however you are free topass either an open filehandle reference or an XML string if you so require.The return value is a tree that XML::XPath can use. The parse method willdie if there is an error in your XML, so be sure to use perl's exceptionhandling mechanism (eval{};) if you want to avoid this.=head2 parsefileThe parsefile method is identical to parse() except it expects a singleparameter that is a string naming a file to open and parse. Again itreturns a tree and also dies if there are XML errors.=head1 NOTICESThis file is distributed as part of the XML::XPath module, and is copyright2000 Fastnet Software Ltd. Please see the documentation for the module as awhole for licencing information.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡一二三区黄网| 美脚の诱脚舐め脚责91| 亚洲图片一区二区| 日韩av电影天堂| 国产一区二区伦理| 91国产精品成人| 欧美一区二区成人| 中日韩av电影| 亚洲高清视频的网址| 国内精品伊人久久久久av一坑| 成人激情校园春色| 欧美精品在线视频| 国产精品女同互慰在线看| 亚洲综合色区另类av| 国产精品一卡二卡在线观看| 99久久免费国产| 日韩精品一区二区三区视频| 亚洲人一二三区| 久久精品国产精品亚洲综合| 色哟哟精品一区| 精品国产乱码久久久久久蜜臀 | 亚洲bt欧美bt精品777| 韩国欧美一区二区| 欧美色图激情小说| 国产精品国产三级国产| 免费精品视频最新在线| 91美女在线看| 精品日韩99亚洲| 亚洲午夜精品在线| 538在线一区二区精品国产| 国产午夜精品久久| 免费一区二区视频| 色综合天天做天天爱| 久久精品人人做| 蜜桃免费网站一区二区三区| 色老综合老女人久久久| 欧美国产1区2区| 国模大尺度一区二区三区| 欧美美女激情18p| 亚洲欧美另类在线| 国产成人av电影在线| 日韩欧美高清一区| 天堂影院一区二区| 色一区在线观看| ...中文天堂在线一区| 精品一区二区三区在线观看| 欧美高清视频在线高清观看mv色露露十八 | 久久久噜噜噜久噜久久综合| 视频一区二区国产| 在线欧美日韩国产| 中文字幕亚洲电影| 国产成人在线免费观看| 精品国产露脸精彩对白| 亚洲国产精品天堂| 色婷婷av一区二区三区大白胸| 欧美激情一区二区三区四区| 国产一区二区主播在线| 精品国产不卡一区二区三区| 日韩主播视频在线| 欧美日韩免费电影| 亚洲一区二区美女| 欧美日韩中文精品| 亚洲一卡二卡三卡四卡五卡| 一本大道久久a久久精二百| 中文字幕在线观看一区| 成人国产精品免费观看动漫| 国产精品无遮挡| 成人av网站在线| 中文字幕va一区二区三区| 成人黄色av网站在线| 国产欧美日韩精品在线| 成人黄色免费短视频| 国产精品家庭影院| 91色婷婷久久久久合中文| 亚洲日本电影在线| 欧美主播一区二区三区| 亚洲h动漫在线| 欧美一级在线免费| 久久99精品久久久久久动态图| 日韩欧美国产成人一区二区| 国产呦精品一区二区三区网站| 久久视频一区二区| 成人在线综合网站| 综合欧美一区二区三区| 在线观看日韩国产| 日韩精品三区四区| 亚洲一区二区黄色| 欧美电视剧在线看免费| a在线播放不卡| 久久电影网站中文字幕| 亚洲人成网站影音先锋播放| 精品女同一区二区| 在线综合亚洲欧美在线视频| 国内精品伊人久久久久av一坑 | 成人精品一区二区三区四区 | 免费三级欧美电影| 国产精品每日更新| 亚洲精品一区二区三区四区高清 | fc2成人免费人成在线观看播放| 男女性色大片免费观看一区二区 | 色婷婷激情一区二区三区| 成人免费在线观看入口| 91色|porny| 亚洲成av人片在线观看无码| 日韩欧美国产精品一区| 高清不卡一区二区在线| 亚洲免费观看高清完整版在线观看熊| 在线看国产一区二区| 免费在线观看精品| 国产精品三级视频| 亚洲欧美激情小说另类| 国产丝袜美腿一区二区三区| 日韩精品一区二区三区在线| 日韩av成人高清| 亚洲一区欧美一区| 伊人性伊人情综合网| 亚洲黄色小视频| 亚洲乱码中文字幕| 一区二区三区.www| 亚洲主播在线播放| 视频精品一区二区| 日韩和欧美的一区| 欧美日韩在线不卡| 香蕉加勒比综合久久| 亚洲精品一区二区三区在线观看 | 成人av先锋影音| 亚洲国产视频在线| 国产欧美日韩另类视频免费观看| 欧美综合在线视频| 国产福利一区二区三区| 亚洲一区在线视频| 久久影视一区二区| 欧美性猛片aaaaaaa做受| 国产精品一级片| 日韩精品欧美精品| 亚洲欧美日韩一区| 国产亚洲制服色| 日韩一区国产二区欧美三区| av一区二区三区黑人| 捆绑变态av一区二区三区| 亚洲激情成人在线| 国产亚洲短视频| 日韩免费性生活视频播放| 在线免费观看成人短视频| 丁香六月综合激情| 久久精品国产精品青草| 亚洲午夜私人影院| 最新中文字幕一区二区三区| 亚洲精品一区二区三区影院| 7777精品伊人久久久大香线蕉的 | 国产精品剧情在线亚洲| 精品剧情v国产在线观看在线| 在线观看欧美日本| 99久久久精品| 国产乱码精品一区二区三区忘忧草| 夜夜精品视频一区二区| 亚洲婷婷在线视频| 久久精品视频免费观看| 日韩免费高清电影| 制服丝袜日韩国产| 欧美专区日韩专区| 色婷婷av一区二区三区大白胸| 丰满亚洲少妇av| 国产成人亚洲综合a∨婷婷图片| 日韩1区2区3区| 日韩经典中文字幕一区| 天使萌一区二区三区免费观看| 一区二区三区四区中文字幕| 最新国产精品久久精品| 国产精品免费视频观看| 久久久国产午夜精品| 26uuu成人网一区二区三区| 日韩欧美专区在线| 欧美一区午夜精品| 91精品国产综合久久精品图片| 欧美性猛交xxxx黑人交| 欧美视频精品在线| 日本精品一级二级| 欧美亚洲国产怡红院影院| 色av综合在线| 欧美日韩小视频| 欧美区一区二区三区| 欧美精品在线观看播放| 欧美一区二区三区婷婷月色| 91精品国产综合久久久久久久| 91麻豆精品国产自产在线| 日韩一区二区在线看| 精品国产亚洲在线| 欧美tk丨vk视频| 久久婷婷综合激情| 国产日韩欧美电影| 中文字幕一区二区三区在线不卡 | 99re热这里只有精品视频| av亚洲精华国产精华精华| 99久久免费视频.com| 91九色02白丝porn| 欧美精品一卡二卡| 欧美r级电影在线观看| 国产亚洲自拍一区| 亚洲免费在线电影|