Branch Coverage

File:blib/lib/XML/Twig.pm
Coverage:87.1%

line%coveragebranch
11550TFunless $parser_version >= $needVersion
11750TFif ($] >= 5.008)
12650TFif (eval 'require Scalar::Util' and defined \&Scalar::Util::weaken) { }
0TFelsif (eval 'require WeakRef') { }
384100TFunless ($args{'MoreOptions'})
386100TFunless $valid_option{$arg}
398100TFif (exists $args{'TwigHandlers'})
405100TFif (exists $args{'StartTagHandlers'})
410100TFif (exists $args{'DoNotChainHandlers'})
413100TFif (exists $args{'IgnoreElts'})
41550TFif (isa($args{'IgnoreElts'}, 'ARRAY'))
420100TFif (exists $args{'Index'})
423100TFif (ref $index eq 'ARRAY')
432100TFif (exists $args{'EltClass'})
434100TFif (exists $args{'MapXmlns'})
440100TFif (exists $args{'KeepOriginalPrefix'})
448100TFif ($args{'ExpandExternalEnts'}) { }
452100TFif ($args{'ExpandExternalEnts'} == -1)
46250TFif (not $args{'NoLWP'} and not _use('URI') and not _use('URI::File') and not _use('LWP')) { }
467100TFif ($args{'DoNotEscapeAmpInAtts'}) { }
479100TFif ($args{'TwigRoots'})
484100TFif ($args{'EndTagHandlers'})
485100TFunless ($$self{'twig_roots'} or $args{'ForceEndTagHandlersUsage'})
498100TFif ($args{'TwigPrintOutsideRoots'})
499100TFunless $$self{'twig_roots'}
502100TFif (_is_fh($args{'TwigPrintOutsideRoots'}))
508100TFif ($args{'KeepSpaces'})
509100TFif $args{'DiscardSpaces'}
510100TFif $args{'KeepSpacesIn'}
514100TFif ($args{'DiscardSpaces'})
515100TFif $args{'KeepSpacesIn'}
519100TFif ($args{'KeepSpacesIn'})
520100TFif $args{'DiscardSpacesIn'}
527100TFif ($args{'DiscardSpacesIn'})
535100TFunless $$self{'twig_keep_spaces'}
538100TFif ($args{'Comments'} eq 'drop') { }
100TFelsif ($args{'Comments'} eq 'keep') { }
100TFelsif ($args{'Comments'} eq 'process') { }
545100TFif ($args{'Pi'} eq 'drop') { }
100TFelsif ($args{'Pi'} eq 'keep') { }
100TFelsif ($args{'Pi'} eq 'process') { }
551100TFif ($args{'KeepEncoding'}) { }
556100TFif defined $args{'ParseStartTag'}
561100TFif $args{'ParseStartTag'}
564100TFif ($args{'OutputFilter'}) { }
571100TFif ($args{'RemoveCdata'}) { }
578100TFif ($args{'OutputTextFilter'}) { }
586100TFif (exists $args{'KeepAttsOrder'}) { }
588100TFif (_use('Tie::IxHash')) { }
597100TFif ($args{'PrettyPrint'})
598100TFif ($args{'Quote'})
599100TFif ($args{'EmptyTags'})
601100TFif (exists $args{'Id'})
602100TFif ($args{'NoProlog'})
603100TFif ($args{'DoNotOutputDTD'})
604100TFif ($args{'LoadDTD'})
605100TFif ($args{'CharHandler'})
607100TFif ($args{'InputFilter'})
608100TFif ($args{'NoExpand'})
609100TFif (my $output_encoding = $args{'OutputEncoding'})
611100TFif (my $tdh = $args{'TopDownHandlers'})
614100TFif ($$self{'twig_roots'}) { }
615100TFif ($$self{'twig_default_print'}) { }
616100TFif ($$self{'twig_keep_encoding'}) { }
641100TFif $weakrefs
650100TFif (not ref $t or not isa($t, 'XML::Twig'))
65550TFif ($] >= 5.008 and ${^UNICODE} and ${^UNICODE} & 24 and isa($_[0], 'GLOB') and -p $_[0])
672100TFif (not $t)
673100TFif (isa($returned, 'XML::Twig') and $$returned{'twig_finish_now'}) { }
69650TFunless _use('File::Temp')
70450TFunless ($$t{'twig_keep_encoding'} or $] < 5.006)
71150TFunless chmod $mode, $tmpfile
713100TFif ($suffix)
715100TFif ($suffix =~ /\*/) { }
71850TFunless rename $file, $backup
72050TFunless rename $tmpfile, $file
73950TF$@ ? :
74450TFunless _use('LWP::Simple')
74650TF$@ ? :
75350TF$@ ? :
759100TF$$t{'ErrorContext'} ? :
76850TF$$t{'ErrorContext'} ? :
770100TFisa($content, 'GLOB') ? :
777100TFif (isa($to_parse, 'GLOB')) { }
100TFelsif ($to_parse =~ /^\s*</) { }
100TFelsif ($to_parse =~ m[^\w+://.*\.html?$]) { }
100TFelsif ($to_parse =~ m[^\w+://]) { }
100TFelsif ($to_parse =~ /\.html?$/) { }
778100TF$to_parse =~ /<html/i ? :
781100TFunless _use('LWP::Simple')
784100TFunless _use('LWP::Simple')
78750TFif ($xml_parse_ok) { }
7910TFif ($doc =~ /<html/i) { }
805100TFif (_is_well_formed_xml($_[0])) { }
809100TFif (_is_well_formed_xml($html)) { }
820100TF$@ ? :
837100TFunless _use('HTML::TreeBuilder', '3.13')
850100TFif ($$options{'indent'})
86550TFif ($@ =~ /^\s*xml declaration not at start of external entity/) { }
50TFelsif ($@ =~ /^\s*not well-formed \(invalid token\)/) { }
871100TFunless (keys %xml_parser_encoding)
873100TFif (not $add_decl) { }
87450TFif ($xml_parser_encoding{$encoding}) { }
0TFelsif ($encoding eq 'euc-jp' and $xml_parser_encoding{'x-euc-jp-jisx0221'}) { }
0TFelsif ($encoding eq 'shift-jis' and $xml_parser_encoding{'x-sjis-jisx0221'}) { }
88150TFif ($add_decl) { }
92050TFif ($$meta{'http-equiv'} and $$meta{'http-equiv'} =~ /^\s*content-type\s*/i and $$meta{'content'} and $$meta{'content'} =~ m[^\s*text/html\s*;\s*charset\s*=\s*(\S*)\s*]i)
93450TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
9380TFif ($converter)
96550TFif ($2 and $block_tag{$2}) { }
0TFelsif ($3 and $block_tag{$3}) { }
96650TFunless $2 =~ m[/>]
984100TFif ($text_type{$type}) { }
1009100TFif ($disallowed{$module})
1010100TFif ($used{$module})
1011100TFif (eval "require $module") { }
101350TFif (${"${module}::VERSION";} >= $version) { }
1025100TFif ($n > 0) { }
100TFelsif ($n < 0) { }
1026100TFif $i == $n
100TFif (&$coderef)
1028100TFif $i == $n
100TFif (&$coderef)
1036100TFif ($uri =~ m[^\w+://]) { }
1043100TFif (defined $base and not $filename =~ m[^(?:[\\/]|\w+:)])
1054100TFunless open TWIG_TO_SLURP, "<$filename"
107750TFunless _use('LWP')
107850TFif ($^O ne 'VMS') { }
107950TFunless pipe README, WRITEME
1080100TFif (my $pid = fork) { }
1083100TF$safe ? :
1085100TF$@ ? :
1097100TFunless $response->is_success
11070TFunless $response->is_success
11080TF$safe ? :
11090TF$@ ? :
1133100TFif $$t{'twig_keep_encoding'}
114150TFif (@saved_default_handler and defined $saved_default_handler[1]) { }
1155100TFif ($$p{'twig'}{'twig_doctype'}{'has_internal'} and not $expat_1_95_2)
1170100TFunless $_[0]
100TFif isa($_[0], 'GLOB') or isa($_[0], 'IO::Scalar')
1177100TFunless _set_special_handler($handlers, $path, $handler, $prev_handler) or _set_pi_handler($handlers, $path, $handler, $prev_handler) or _set_level_handler($handlers, $path, $handler, $prev_handler) or _set_regexp_handler($handlers, $path, $handler, $prev_handler) or _set_xpath_handler($handlers, $path, $handler, $prev_handler)
1195100TFif ($path =~ /^\s*($ALL|$DEFAULT|#COMMENT)\s*$/io) { }
1205100TFif (my $handler_data = _parse_xpath_handler($path, $handler)) { }
1217100TF$$handlers{'xpath_handler'}{$tag} ? :
1219100TFif ($prev_handler)
1221100TFif $$handler_data{'handler'}
1224100TFunless ($$a{'score'}{'type'} || 0) <=> ($$b{'score'}{'type'} || 0) or ($$b{'score'}{'anchored'} || 0) <=> ($$a{'score'}{'anchored'} || 0) or ($$b{'score'}{'steps'} || 0) <=> ($$a{'score'}{'steps'} || 0) or ($$b{'score'}{'predicates'} || 0) <=> ($$a{'score'}{'predicates'} || 0) or ($$b{'score'}{'tests'} || 0) <=> ($$a{'score'}{'tests'} || 0)
1239100TFif ($path =~ /^\s*(?:\?|#PI)\s*(?:([^\s]*)\s*)$/) { }
1253100TFif ($path =~ /^ \s* level \s* \( \s* ([0-9]+) \s* \) \s* $/ox) { }
1269100TFif ($path =~ /^\(\?([xism]*)(?:-[xism]*)?:(.*)\)$/) { }
128850TFif ($DEBUG_HANDLER >= 1)
129250TFif ($DEBUG_HANDLER and $path_to_check =~ /\S/)
1293100TFif $path_to_check =~ /\S/
1309100TFif ($2) { }
1310100TFif ($last_token_is_sep)
1314100TFif (defined $last_token_is_sep and not $last_token_is_sep)
1320100TFif ($last_token_is_sep)
1334100TF$xpath_original =~ m[^\s*/(?!/)] ? :
134350TF$DEBUG_HANDLER >= 2 ? :
1345100TFif ($predicate)
134650TFif ($DEBUG_HANDLER >= 2)
134950TFif ($DEBUG_HANDLER >= 2)
1352100TF$tag ne '*' ? :
1358100TFif ($sep eq '/') { }
50TFelsif ($sep eq '//') { }
138650TF$DEBUG_HANDLER >= 2 ? :
1397100TFif ($anchored)
139950TF$DEBUG_HANDLER >= 2 ? :
140350TFif $DEBUG_HANDLER >= 2
140550TFif $DEBUG_HANDLER >= 1
140750TFif ($@)
141050TFif $DEBUG_HANDLER >= 1
141150TFif $DEBUG_HANDLER >= 1
1427100TFif ($func or $string_regexp or $string_test_num or $string_test_alpha)
1429100TFif (defined $string) { }
100TFelsif ($att) { }
100TFelsif ($bare_att) { }
100TFelsif ($num_test and $num_test eq '=') { }
100TFelsif ($alpha_test) { }
100TFelsif ($func and $func =~ /^string/) { }
100TFelsif ($string_regexp and $string_regexp =~ /string\(\s*($REG_NAME)\s*\)\s*($REG_MATCH)\s*($REG_REGEXP)/) { }
100TFelsif ($string_test_alpha and $string_test_alpha =~ /string\(\s*($REG_NAME)\s*\)\s*($REG_COMP)\s*($REG_STRING)/) { }
50TFelsif ($string_test_num and $string_test_num =~ /string\(\s*($REG_NAME)\s*\)\s*($REG_COMP)\s*($REG_NUMBER)/) { }
50TFelsif ($and_or) { }
1430100TF$att =~ /^#/ ? :
1433100TF$bare_att =~ /^#/ ? :
14450TF$2 eq '=' ? :
14480TF$and_or eq 'and' ? :
148350TFif $$handlers{'attcond_handlers'}
1563100TFif isa($$handlers{$path}, 'CODE')
1573100TFif (my $type = $$handler_data{'test_on_text'})
1588100TFif ($$t{'twig_parsing'})
1592100TFif $weakrefs
1609100TF$@ ? :
1615100TF$@ ? :
1629100TFif $t->root
1638100TFunless $$t{'twig_current'}
1639100TFif ($$t{'twig_stored_spaces'} or $option{'force'} or $$t{'twig_preserve_space'})
1640100TFif ($$t{'twig_current'}->is_pcdata) { }
1644100TFunless (defined $$t{'twig_space_policy'}{$current_gi})
1647100TFif ($$t{'twig_space_policy'}{$current_gi} or not $$t{'twig_stored_spaces'} =~ /\n/ or $option{'force'} or $$t{'twig_preserve_space'})
1672100TFif ($$t{'twig_in_pcdata'})
1679100TFif (my $func = $$t{'parse_start_tag'}) { }
50TFelsif ($$t{'twig_entities_in_attribute'}) { }
1688100TFif ($$t{'twig_read_external_dtd'})
1691100TFif (my $filter = $$t{'twig_input_filter'})
1696100TFif $$t{'twig_map_xmlns'}
1703100TFif $weakrefs
1706100TFif $parent
1710100TFif ($parent) { }
1712100TFif ($prev_sibling)
1718100TFunless $$parent{'first_child'}
172550TFif defined $$t{'twig_dtd_handler'}
1730100TFif ($$t{'twig_default_print'}) { }
100TFelsif ($$t{'twig_roots'}) { }
1738100TF$p->recognized_string =~ m[/\s*>$]s ? :
1740100TFif $$t{'extra_data'}
1745100TFif (defined $id)
1747100TFif $weakrefs
1751100TFif ($$t{'twig_starttag_handlers'})
1758100TFunless &$handler($t, $elt)
1760100TFif (my $all = $$t{'twig_starttag_handlers'}{'handlers'}{$ALL})
1765100TFif ($$t{'twig_ignore_elts_handlers'})
1768100TFif (@handlers)
1771100TFif ($$elt{'att'}{'xml:space'} and $$elt{'att'}{'xml:space'} eq 'preserve')
1781100TFif (not $$t{'twig_keep_original_prefix'} and my $mapped_prefix = $$t{'twig_map_xmlns'}{$uri})
1784100TFif ($new_prefix eq '#default') { }
1790100TFif ($$t{'twig_keep_original_prefix'}) { }
1795100TFif ($$ns_info{'mapped_prefix'})
1801100TFif ($att_name) { }
1804100TFif ($$ns_info{'mapped_prefix'})
1813100TFif $map_att
1819100TFif ($att_name) { }
1834100TFunless $$ns_info{'uri'}
1845100TFif ($p->expand_ns_prefix($prefix) eq $uri)
1857100TFif (not exists $value{$att} and exists $$attlist{$att}{'default'} and $$attlist{$att}{'default'} ne '#IMPLIED')
1879100TFif ($string =~ s[^<\s*($REG_NAME)\s*[\s>/]][]s) { }
1892100TFif $weakrefs
1902100TFif ($$t{'twig_map_xmlns'})
1911100TFif ($$t{'twig_in_pcdata'})
191350TFif $$elt{'parent'}
1919100TFif $parent
1923100TFif ($$parent{'twig_to_be_normalized'})
1925100TFif $$t{'extra_data'}
1928100TFif ($$t{'twig_handlers'})
1932100TFif ($$t{'twig_tdh'}) { }
1933100TFif (@handlers)
1934100TFif (my $all = $$t{'twig_handlers'}{'handlers'}{$ALL})
1942100TFunless &$handler($t, $elt)
1944100TFif (my $all = $$t{'twig_handlers'}{'handlers'}{$ALL})
1950100TFif ($$t{'twig_root_depth'} and $p->depth == $$t{'twig_root_depth'})
1951100TFif ($$t{'twig_default_print'}) { }
1954100TFif ($$t{'twig_keep_encoding'}) { }
1963100TFif ($$elt{'att'}{'xml:space'} and $$elt{'att'}{'xml:space'} eq 'preserve')
197250TFif (@{$$t{'twig_handlers_to_trigger'};})
197750TFunless &$handler($t, $handled_elt)
2001100TFif (my $found_path = &$trigger($$t{'_twig_context_stack'}))
2008100TFif (not @found_handlers and defined $$handlers{'handlers'}{$DEFAULT})
2011100TFif (@found_handlers and $$t{'twig_do_not_chain_handlers'})
2025100TFif (not $uri and not $name =~ /^xml/)
2026100TFif ($uri) { }
2027100TFif (my $mapped_prefix = $$t{'twig_map_xmlns'}{$uri}) { }
2031100TFif ($prefix eq '#default')
2032100TF$prefix ? :
2046100TFif ($$t{'twig_keep_encoding'})
2047100TFif (not $$t{'twig_in_cdata'}) { }
2052100TFif (length $string < 1024) { }
2062100TFif ($$t{'twig_input_filter'})
2065100TFif ($$t{'twig_char_handler'})
2070100TFif ($$t{'twig_in_cdata'}) { }
100TFelsif ($$t{'twig_in_pcdata'}) { }
2076100TFif ($$t{'extra_data'})
2084100TFif ($string =~ /\A\s*\Z/s) { }
2085100TFif ($$t{'extra_data'}) { }
2100100TFif ($$t{'extra_data'})
2119100TFif ($$t{'twig_in_pcdata'}) { }
2130100TFif ($t->_space_policy($XML::Twig::index2gi[$$twig_current{'gi'}]) and $$t{'twig_stored_spaces'})
2136100TFif (my $prev_sibling = $$twig_current{'last_child'}) { }
2149100TFif ($$t{'extra_data'})
2168100TFif ($$t{'twig_handlers'})
2172100TFunless &$handler($t, $elt)
218950TFunless &$handler($t, $pi)
100TFif ($handler)
2194100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{$target})
2196100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{''})
2198100TFdefined $data && $data ne '' ? :
2203100TFif (my $handler = $$t{'twig_handlers'}{'handlers'}{'#COMMENT'})
2209100TFif (my $handler = $$t{'twig_handlers'}{'handlers'}{'#COMMENT'})
2211100TFif (not defined $comment or $comment eq '')
2224100TFif ($$t{'twig_keep_encoding'})
2238100TFif ($$t{'twig_keep_encoding'})
2252100TFif ($$t{'twig_input_filter'})
2256100TFif ($keep) { }
100TFelsif ($process) { }
2258100TFif ($$t{'twig_stored_spaces'})
2273100TFif ($$t{'extra_data'})
2278100TFif (not $t->root) { }
100TFelsif ($$t{'twig_in_pcdata'}) { }
100TFelsif ($twig_current) { }
2288100TFif ($t->_space_policy($XML::Twig::index2gi[$$twig_current{'gi'}]) and $$t{'twig_stored_spaces'})
2297100TFif ($twig_current)
2323100TF$p->isa('XML::Twig') ? :
2326100TFif ($$t{'extra_data'})
2331100TFif $$t{'twig_tdh'}
2333100TFif $$t{'twig_original_selected_fh'}
2335100TFif (exists $$t{'twig_autoflush_data'})
2337100TFif $$t{'twig_autoflush_data'}{'fh'}
2338100TFif $$t{'twig_autoflush_data'}{'args'}
2360100TFif ($prev_sibling) { }
2376100TFif $$t{'twig_discard_spaces'}
2377100TFif $$t{'twig_keep_spaces'}
2378100TFif $$t{'twig_keep_spaces_in'} and $$t{'twig_keep_spaces_in'}{$gi}
2380100TFif $$t{'twig_discard_spaces_in'} and $$t{'twig_discard_spaces_in'}{$gi}
2396100TFif ($sysid)
2397100TFif ($ndata) { }
2398100TFif (not -f _based_filename($sysid, $p->base))
2401100TFif ($$t{'twig_expand_external_ents'})
2403100TFif (not defined $val)
2404100TFif ($$t{'twig_extern_ent_nofail'}) { }
2414100TFif ($missing_entity)
241750TFif ($entity_list)
241950TFif ($parser_version > 2.27)
2423100TFif ($$t{'twig_keep_encoding'})
242450TFif (defined $$ent{'val'} and not $ent_decl =~ /["']/)
24260TF$val =~ /"/ ? :
243150TFunless $$t{'twig_doctype'}{'internal'} =~ /<!ENTITY\s+$name\s+/
244350TFif ($$t{'twig_no_expand'})
24440TF$$t{'twig_keep_encoding'} ? :
2449100TFif (not defined $ent_content)
245450TFif ($$t{'twig_extern_ent_nofail'}) { }
248950TFif ($parser_version > 2.27) { }
2505100TFif ($$t{'twig_read_external_dtd'} and $sysid)
251450TFif $t_dtd->entity_list
253050TFif ($parser_version > 2.27 and $$t{'twig_doctype'}{'internal'} =~ /(^|>)\s*$/)
253150TF$XML::Twig::Elt::keep_encoding ? :
253250TFunless ($text)
255150TFif ($parser_version > 2.27 and $$t{'twig_doctype'}{'internal'} =~ /(^|>)\s*$/)
255250TF$XML::Twig::Elt::keep_encoding ? :
255350TFunless ($text)
2557100TFif $fixed
255850TFif defined $default
2560100TFif ($$t{'twig_dtd'}{'att'}{$gi}) { }
257350TFif defined $default
2586100TFunless $string =~ /^&([^;]*);$/
258850TFif ($p->original_string =~ /^</ and $p->original_string =~ />$/) { }
25900TFif $$t{'twig_do_not_escape_amp_in_atts'}
2594100TFif ($$t{'twig_keep_encoding'}) { }
2617100TFif ($$t{'twig_in_pcdata'}) { }
2634100TFif (my $prev_sibling = $$twig_current{'last_child'}) { }
263950TFif $twig_current
264050TFif $twig_current
2656100TFunless $$t{'twig_xmldecl'} or $$t{'output_encoding'}
2659100TFif ($decl) { }
2666100TFif ($$t{'output_encoding'}) { }
100TFelsif ($$decl{'encoding'}) { }
2675100TFif (defined $$decl{'standalone'})
2677100TF$$decl{'standalone'} ? :
2689100TF$output_filter ? :
2694100TFunless defined $$t{'twig_doctype'}
269650TFif defined $name
2697100TFif defined $system
2698100TFif defined $public
2699100TFif defined $internal
2704100TFunless my $doctype = $$t{'twig_doctype'}
2710100TFunless my $doctype = $$t{'twig_doctype'}
2716100TFunless my $doctype = $$t{'twig_doctype'}
2722100TFunless my $doctype = $$t{'twig_doctype'}
2736100TFif $elt
276350TF_is_fh($_[0]) ? :
2770100TFif ($$t{'no_prolog'})
2772100TFdefined $$t{'no_dtd_output'} ? :
50TF$$t{'no_prolog'} ? :
2785100TFif ($doctype)
278650TFif $$doctype{'name'}
2787100TFif $$doctype{'pub'}
2788100TFif $$doctype{'sysid'} and not $$doctype{'pub'}
2789100TFif $$doctype{'sysid'}
2792100TFif ($update_dtd) { }
100TFelsif ($doctype) { }
2793100TFif ($doctype) { }
50TFelsif (not $$t{'twig_dtd'} and keys %{$t->entity_list;}) { }
2796100TFif ($internal)
280150TFif $t->entity_list
2802100TFif ($internal)
2812100TFif (my $internal = $$doctype{'internal'})
2824100TFif ($doctype_text) { }
283150TF$output_filter ? :
2856100TFunless open TWIG_PRINT_TO_FILE, ">$filename"
285750TFif ($] > 5.006 and not $$t{'twig_keep_encoding'})
2865100TF_is_fh($_[0]) ? :
2868100TFdefined $fh ? :
2869100TFdefined $args{'PrettyPrint'} ? :
2870100TFdefined $args{'EmptyTags'} ? :
2879100TFif defined $old_pretty
2880100TFif defined $old_empty_tag
2881100TFif ($fh)
289050TFif $$t{'twig_tdh'}
2892100TFif $$t{'twig_completely_flushed'}
2894100TF_is_fh($_[0]) ? :
2895100TFdefined $fh ? :
2896100TFref $_[0] ? :
2900100TFif (defined $args{'PrettyPrint'})
2906100TFif ($args{'EmptyTags'})
2915100TFif ($up_to) { }
100TFelsif ($$t{'twig_current'}) { }
2927100TFunless ($elt->_flushed)
2929100TFif ($$t{'twig_autoflush'})
2931100TFif $fh
2932100TFif @_
2940100TFif ($last_elt and $last_elt->in($elt)) { }
2942100TFunless ($elt->_flushed)
2954100TFif $last_elt and $elt == $last_elt
2959100TFif ($flush_trailing_data)
2964100TFif defined $old_select
2965100TFif defined $old_pretty
2966100TFif defined $old_empty_tag_style
2977100TFif (_is_fh($_[0])) { }
2994100TFif (defined $args{'PrettyPrint'})
3000100TFif (defined $args{'EmptyTags'})
3012100TFif defined $old_pretty
3013100TFif defined $old_empty_tag_style
302750TFif $$t{'twig_tdh'}
3031100TFif ($up_to) { }
100TFelsif ($$t{'twig_current'}) { }
3042100TFif ($last_elt and $last_elt->in($elt)) { }
3050100TFif $last_elt and $elt == $last_elt
307450TFif $] < 5.006
3077100TFref $twig_or_class ? :
3082100TFif $elt_class->can($att) and not $accessor{$att}
3085100TFif (not $accessor{$att})
3089100TFif (@_)
3103100TFif $root->passes($cond)
3115100TFif $t->root->matches($cond)
3121100TFif (isa($_[0], 'ARRAY')) { }
3134100TFunless @unique and $unique[-1] == $current
3140100TFif (isa($_[0], 'ARRAY')) { }
3157100TFdefined $index ? :
3165100TFif (not $cond && !$root->passes($cond)) { }
3184100TFif ($root->passes($cond)) { }
3213100TFunless $index = $XML::Twig::gi2index{$old_gi}
322550TFunless my $doctype = $$t{'twig_doctype'}
3232100TFif ($$dtd{'att'}{$gi})
3237100TFif ($$attlist{$att}{'fixed'}) { }
324650TFif $t->entity_list
3254100TF_is_fh($_[0]) ? :
3255100TFif ($fh) { }
3272100TFunless $$t{'twig_parsing'}
328050TFif ($$t{'twig_map_xmlns'}) { }
3295100TFif (not defined $fh) { }
50TFelsif (defined $fh) { }
329950TFif $old_fh
3303100TFif ($$t{'twig_keep_encoding'}) { }
3321100TFif (not $input_filter or isa($input_filter, 'CODE')) { }
50TFelsif ($input_filter eq 'latin1') { }
50TFelsif ($filter{$input_filter}) { }
338150TFif ($$t{'twig_root'} and isa($$t{'twig_root'}, 'XML::Twig'))
3386100TFif $$t{'twig_root'}
340650TFif ($string eq '<!DOCTYPE') { }
342250TFif ($expat_1_95_2 and $p->recognized_string eq '[' and not $$p{'twig'}{'expat_1_95_2_seen_bracket'}) { }
344650TFif ($string eq '<!DOCTYPE') { }
346950TFif ($name)
347350TFif $name
347450TFif $pubid
3475100TFif $sysid and not $pubid
3476100TFif $sysid
3477100TFif $internal and not $expat_1_95_2
3478100TFunless $internal or $expat_1_95_2
348950TFif ($name)
349350TFif $name
349450TFif $pubid
3495100TFif $sysid and not $pubid
3496100TFif $sysid
3497100TFif $internal
3498100TFunless $internal or $expat_1_95_2
3528100TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3533100TFunless ($p->depth == 0)
3534100TFif ($$t{'twig_map_xmlns'})
3539100TFif (_handler($t, $$t{'twig_roots'}, $gi, \%att)) { }
100TFelsif ($p->depth == 0) { }
100TFelsif ($$t{'twig_starttag_handlers'}) { }
3547100TFif $tag
355950TFunless $last_handler_res
3562100TFif $tag and !@handlers || $last_handler_res
3566100TFif $tag
3577100TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3582100TFif ($$t{'twig_endtag_handlers'})
358850TFif (not $last_handler_res)
3595100TFif defined $tag
3597100TFif ($p->depth == 0)
360750TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3612100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{$target} || $$t{'twig_handlers'}{'pi_handlers'}{''}) { }
362450TFif defined $pi
363750TFif ($action eq 'print')
365150TFif ($action eq 'print')
3658100TFif (not $$t{'twig_ignore_level'})
3672100TFif ($$t{'twig_endtag_handlers'})
3690100TFif (not $elt && isa($elt, 'XML::Twig::Elt'))
3696100TFunless ($elt == $current or $$current{'last_child'} and $elt == $$current{'last_child'} or $current->in($elt))
3699100TF$current == $elt ? :
370850TFif ($action eq 'print')
3723100TFif ($$elt_in_stack{'_elt'} and $elt == $$elt_in_stack{'_elt'})
3734100TFif ($output_fh and not $$t{'twig_output_fh_selected'})
3746100TFunless $$t{'twig_output_fh'}
375550TFif $_[0]{'twig_xmldecl'}
376050TFunless $t->xml_version
3770100TFif $encoding
377550TFif $_[0]{'twig_xmldecl'}
378450TFif $_[0]{'twig_xmldecl'}
378950TFunless $t->xml_version
3797100TFif defined $_[0]{'twig_parser'}
3803100TFif defined $_[0]{'twig_parser'}
3812100TFif (my $start_document = $handler->can('start_document'))
381750TFif $t->root
381850TFif (my $end_document = $handler->can('end_document'))
3840100TFif ($$t{'twig_current'}) { }
3846100TFunless ($elt->_flushed)
384850TFif (my $start_document = $handler->can('start_document'))
3856100TFif ($last_elt and $last_elt->in($elt)) { }
3858100TFunless ($elt->_flushed)
386050TFif (my $start_element = $handler->can('start_element'))
386150TFif (my $tag_data = &$start_tag_data($elt))
3873100TFif $last_elt and $elt == $last_elt
3877100TFif (not $$t{'twig_parsing'})
387850TFif (my $end_document = $handler->can('end_document'))
3897100TFif (my $xml_decl = $handler->can('xml_decl'))
3904100TFunless $doctype
391050TFif (my $start_dtd = $handler->can('start_dtd'))
391550TFif (my $end_dtd = $handler->can('end_dtd'))
392350TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
393750TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
396150TFunless _use('HTML::Entities')
396750TFif ($] < 5.008) { }
397950TFif ($] < 5.008) { }
399650TFif ($len == 2) { }
0TFelsif ($len == 3) { }
0TFelsif ($len == 4) { }
0TFelsif ($len == 1) { }
4014100TF$hex ? :
402050TF$_[1] ? :
402150TFunless _use('Unicode::Map8')
402250TFunless _use('Unicode::String')
402450TFunless $cnv = 'Unicode::Map8'->new($enc)
403250TFunless ($sub)
403750TF$_[1] ? :
403850TFunless _use('Text::Iconv')
403950TFunless $cnv = 'Text::Iconv'->new('utf8', $enc)
50TFunless $cnv = 'Text::Iconv'->new('utf8', $enc)
4047100TFunless ($sub)
404850TFif ($@ =~ /^Unsupported conversion: Invalid argument/) { }
405850TF$_[1] ? :
406050TFunless $sub
4068100TFwantarray ? :
407850TFif $t->root
4110100TFunless $ents_to_add and %$ents_to_add
4131100TFif (isa(ref $_[0], 'XML::Twig::Entity')) { }
414750TFdefined $fh ? :
415250TFif isa($ent, 'XML::Twig::Entity')
415450TFif defined $old_select
4189100TFif defined $val
4190100TFif defined $sysid
4191100TFif defined $pubid
4192100TFif defined $ndata
4193100TFif defined $param
4202100TFdefined $_[0]{'sysid'} ? :
420350TFdefined $_[0]{'pubid'} ? :
4204100TFdefined $_[0]{'ndata'} ? :
4205100TFdefined $_[0]{'param'} ? :
421150TFif (not defined $text)
421250TFif ($fh) { }
421950TFif (not defined $text)
4225100TFif not $$ent{'name'}
4229100TFif $$ent{'param'}
4232100TFif (defined $$ent{'val'} and not defined $$ent{'sysid'} and not defined $$ent{'pubid'}) { }
50TFelsif (defined $$ent{'sysid'}) { }
4236100TFif $$ent{'pubid'}
4237100TFunless $$ent{'pubid'}
4239100TFif $$ent{'ndata'}
424550TF$_[0] =~ /"/ ? :
434550TFif (eval 'require Scalar::Util' and defined &Scalar::Util::weaken) { }
0TFelsif (eval 'require WeakRef') { }
4364100TFunless @_
4371100TFref $_[0] eq 'HASH' ? :
4373100TFif ($atts and defined $$atts{'#CDATA'})
4380100TFif ($gi eq '#PCDATA') { }
100TFelsif ($gi eq '#ENT') { }
100TFelsif ($gi eq '#CDATA') { }
100TFelsif ($gi eq '#COMMENT') { }
100TFelsif ($gi eq '#PI') { }
4381100TFif (grep {ref $_;} @_)
4387100TFif (grep {ref $_;} @_)
4391100TFif (grep {ref $_;} @_)
4395100TFif (grep {ref $_;} @_)
4400100TFif (@_) { }
4406100TFif ($atts)
4408100TFif (defined $$atts{'#ASIS'})
4409100TFif (defined $$atts{'#EMPTY'})
4410100TFif keys %$atts
4411100TFif $$atts{$ID}
4424100TFif (ref $class)
4433100TFif ($$t{'twig_id_list'})
4450100TFif ($elt->tag eq 'head') { }
100TFelsif ($elt->tag ne 'html') { }
4467100TFunless (defined $XML::Twig::gi2index{$gi})
4491100TFif ($qname =~ /^([^:]*):/) { }
4512100TFdefined $_[0] ? :
4513100TF$prefix ? :
45230TFif (my $prefix = $elt->ns_prefix)
45250TFif (not $missing_prefix{$prefix} and not $elt->namespace)
45300TFif (not $root->_inherits_declared_prefix($prefix))
45410TFif ($elt->_declares_prefix($prefix)) { }
45510TFif $att eq "xmlns:$prefix"
45570TF$prefix ? :
45650TFif ($elt->_ns_prefix and $elt->namespace eq $uri)
4580100TFif $gi_nb >= $XML::Twig::SPECIAL_GI
4586100TFif $_[0]{'gi'} >= $XML::Twig::SPECIAL_GI
462650TFdefined $_[1] ? :
462950TFif $_[0]{'empty'} or 0
4637100TFif (exists $$descendant{'cdata'})
464950TFif $$descendant{'asis'}
4660100TFunless $curr_elt
4667100TFif ($elt->_extra_data_in_pcdata)
4686100TFif ($$elt{'extra_data_before_end_tag'}) { }
4702100TFif ((my $offset = index($modified, $initial)) != -1) { }
100TFelsif (($offset = index($initial, $modified)) != -1) { }
4710100TFif $$_{'offset'} >= 0
4713100TFunless _match_extra_data_words($elt, $initial, $modified) or _match_extra_data_chars($elt, $initial, $modified)
4740100TFif (@$initial <= @$modified) { }
4743100TFif ($ok)
4758100TFif ($ok)
477250TFif ($$cpi{'offset'} < $prev_pos)
4789100TFif ($s_word ne $l_word)
4794100TFif (not @$long and $s_word ne $l_word)
484050TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#PI'})
485550TFif (defined $data and $data ne '')
4862100TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#COMMENT'})
4879100TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#CDATA'})
4902100TFunless $elt->is_elt
4904100TFif $child->is_elt
4912100TFunless $child->is($exp)
4918100TFunless my $child = $$elt{'first_child'}
4919100TFunless $child->passes($exp)
4920100TFif $$child{'next_sibling'}
4973100TF$cond =~ s/^\s*!// ? :
4975100TFif (ref $cond eq 'CODE')
4977100TFif (ref $cond eq 'Regexp') { }
4981100TFif ($cond eq '#ELT') { }
100TFelsif ($cond eq '#TEXT') { }
100TFelsif ($cond =~ /^\s*($REG_NAME_W)\s*$/o) { }
100TFelsif ($cond =~ /^\s*($REG_REGEXP)\s*$/o) { }
100TFelsif ($cond =~ /^\s*($REG_NAME_W)?\s* # $1 \[\s*(-?)\s*(\d+)\s*\] # [$2] \s*$/ox) { }
100TFelsif ($cond =~ /^\s*\.([\w-]+)\s*$/o) { }
100TFelsif ($cond =~ /^\s*($REG_NAME_W?)\s*($REG_PREDICATE)\s*$/) { }
100TFelsif ($cond =~ /^\s*($REG_NAKED_PREDICATE)\s*$/) { }
4987100TFif ($1 ne '*') { }
4991100TFif ($gi) { }
5013100TF$neg ? :
5014100TFif ($gi and $gi ne '*') { }
5026100TF$tag && $tag ne '*' ? :
5040100TFif ($@)
5054100TFif (defined $string) { }
100TFelsif ($att) { }
100TFelsif ($bare_att) { }
50TFelsif ($num_test and $num_test eq '=') { }
100TFelsif ($alpha_test) { }
100TFelsif ($func and $func =~ /^(?:string|text)/) { }
100TFelsif ($string_regexp and $string_regexp =~ /(?:string|text)\(\s*($REG_NAME)\s*\)\s*($REG_MATCH)\s*($REG_REGEXP)/) { }
100TFelsif ($string_eq and $string_eq =~ /(?:string|text)\(\s*($REG_NAME)\s*\)\s*(!?=)\s*($REG_VALUE)/) { }
50TFelsif ($string_test and $string_test =~ /(?:string|text)\(\s*($REG_NAME)\s*\)\s*([<>]=?)\s*($REG_VALUE)/) { }
100TFelsif ($and_or) { }
5063100TF$and_or eq 'and' ? :
5090100TFif ($op eq '=') { }
100TFelsif ($op eq '!=') { }
5097100TFunless $cond
5105100TFif $XML::Twig::weakrefs
5144100TFif ($child) { }
5147100TFif ($cond =~ /^\s*($REG_NAME)/) { }
5160100TFif $XML::Twig::weakrefs
5176100TFif $XML::Twig::weakrefs
5208100TFunless $new_class
521050TF$class ? :
5226100TFunless $elt->tag eq 'span' and $elt->class
5232100TFunless $elt->tag eq 'div' and $elt->class
523950TFunless defined $elt_class
5240100TF$elt->class =~ /(?:^|\s)\Q$class\E(?:\s|$)/ ? :
5249100TFif keep_atts_order()
5250100TFisa($_[0] || '', 'HASH') ? :
5252100TFif (exists $atts{$ID})
5264100TFunless ($$elt{'att'})
5266100TFif keep_atts_order()
5272100TFif ($att eq $ID)
5294100TFunless defined $value
53030TFif ($att ne lc $att)
5314100TFif exists $$elt{'att'}{$ID}
5325100TFif $XML::Twig::weakrefs
5341100TFif (defined $$elt{'att'}{$ID}) { }
534450TF$_[0] && isa($_[0], 'CODE') ? :
535350TFunless (exists $$elt{'att'})
5354100TFunless (exists $$elt{'att'}{$ID})
5360100TFunless ($t)
536150TFif (exists $$t{'twig_id_list'}{$id})
5407100TFif $child->passes($cond)
5416100TFwantarray ? :
5423100TFwantarray ? :
5430100TFunless $child->passes($cond)
5440100TFif $elt->passes($cond)
5449100TFif $elt->passes($cond)
5458100TF$include_self ? :
5470100TFif (defined $$elt{'att'}{$att} and !%tags || $tags{$XML::Twig::index2gi[$$elt{'gi'}]})
5484100TFif (defined $$elt{'att'}{$att} and !%tags || $tags{$XML::Twig::index2gi[$$elt{'gi'}]})
5496100TFif $elt->namespace('')
5518100TFif defined $_[0] and isa($_[0], 'XML::Twig::Elt')
5524100TFif ($cond)
5525100TFunless (defined($ind = $XML::Twig::gi2index{$cond}))
5530100TFif ($next_elt = $$elt{'first_child'}) { }
100TFelsif ($next_elt = $$elt{'next_sibling'}) { }
5537100TFif $subtree_root and $elt == $subtree_root
5545100TFif $subtree_root and $elt == $subtree_root
5550100TFif $subtree_root and $subtree_root == $next_elt
5553100TFif $subtree_root and $subtree_root == $next_elt
5574100TFif (not $cond or $last_descendant->matches($cond)) { }
5595100TFif (defined $_[0] and isa($_[0], 'XML::Twig::Elt'))
5597100TFif $elt == $subtree_root
5603100TFif $elt == $subtree_root
5604100TFif ($prev_elt = $$elt{'prev_sibling'}) { }
5620100TF$elt ? :
5626100TFif not $cond or $elt->matches($cond)
5632100TFif (not $cond)
5634100TFif ($following) { }
5648100TF$elt ? :
5654100TFif not $cond or $elt->matches($cond)
5660100TFif (not $cond)
5662100TFif ($preceding) { }
5675100TF$cond ? :
5689100TFif (isa($ancestor, 'XML::Twig::Elt')) { }
5691100TFif $elt == $ancestor
5695100TFif $elt->matches($ancestor)
5702100TFunless my $dest = $elt->first_child(@_)
5713100TFunless my $dest = $elt->first_child(@_)
5719100TFunless my $dest = $$elt{'first_child'}
5725100TFunless my $dest = $elt->last_child(@_)
5731100TFunless my $dest = $elt->last_child(@_)
5737100TFunless my $dest = $$elt{'last_child'}
5743100TFunless my $dest = $elt->child(@_)
5749100TFunless my $dest = $elt->child(@_)
5756100TFunless my $dest = $elt->child($nb)
5762100TFunless my $dest = $elt->_prev_sibling(@_)
5768100TFunless my $dest = $elt->_prev_sibling(@_)
5774100TFunless my $dest = $$elt{'prev_sibling'}
5780100TFunless my $dest = $elt->next_sibling(@_)
5786100TFunless my $dest = $elt->next_sibling(@_)
5792100TFunless my $dest = $$elt{'next_sibling'}
5798100TFunless my $dest = $elt->prev_elt(@_)