Branch Coverage

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

line%coveragebranch
11550TFunless $parser_version >= $needVersion
11750TFif ($] >= 5.008)
12650TFif (eval 'require Scalar::Util' and defined \&Scalar::Util::weaken) { }
0TFelsif (eval 'require WeakRef') { }
385100TFunless ($args{'MoreOptions'})
387100TFunless $valid_option{$arg}
399100TFif (exists $args{'TwigHandlers'})
406100TFif (exists $args{'StartTagHandlers'})
411100TFif (exists $args{'DoNotChainHandlers'})
414100TFif (exists $args{'IgnoreElts'})
41650TFif (isa($args{'IgnoreElts'}, 'ARRAY'))
421100TFif (exists $args{'Index'})
424100TFif (ref $index eq 'ARRAY')
433100TFif (exists $args{'EltClass'})
435100TFif (exists $args{'MapXmlns'})
441100TFif (exists $args{'KeepOriginalPrefix'})
449100TFif ($args{'ExpandExternalEnts'}) { }
453100TFif ($args{'ExpandExternalEnts'} == -1)
46350TFif (not $args{'NoLWP'} and not _use('URI') and not _use('URI::File') and not _use('LWP')) { }
468100TFif ($args{'DoNotEscapeAmpInAtts'}) { }
480100TFif ($args{'TwigRoots'})
485100TFif ($args{'EndTagHandlers'})
486100TFunless ($$self{'twig_roots'} or $args{'ForceEndTagHandlersUsage'})
499100TFif ($args{'TwigPrintOutsideRoots'})
500100TFunless $$self{'twig_roots'}
503100TFif (_is_fh($args{'TwigPrintOutsideRoots'}))
509100TFif ($args{'KeepSpaces'})
510100TFif $args{'DiscardSpaces'}
511100TFif $args{'KeepSpacesIn'}
515100TFif ($args{'DiscardSpaces'})
516100TFif $args{'KeepSpacesIn'}
520100TFif ($args{'KeepSpacesIn'})
521100TFif $args{'DiscardSpacesIn'}
528100TFif ($args{'DiscardSpacesIn'})
536100TFunless $$self{'twig_keep_spaces'}
539100TFif ($args{'Comments'} eq 'drop') { }
100TFelsif ($args{'Comments'} eq 'keep') { }
100TFelsif ($args{'Comments'} eq 'process') { }
546100TFif ($args{'Pi'} eq 'drop') { }
100TFelsif ($args{'Pi'} eq 'keep') { }
100TFelsif ($args{'Pi'} eq 'process') { }
552100TFif ($args{'KeepEncoding'}) { }
557100TFif defined $args{'ParseStartTag'}
562100TFif $args{'ParseStartTag'}
565100TFif ($args{'OutputFilter'}) { }
572100TFif ($args{'RemoveCdata'}) { }
579100TFif ($args{'OutputTextFilter'}) { }
587100TFif (exists $args{'KeepAttsOrder'}) { }
589100TFif (_use('Tie::IxHash')) { }
598100TFif ($args{'PrettyPrint'})
599100TFif ($args{'EscapeGt'})
600100TFif ($args{'Quote'})
601100TFif ($args{'EmptyTags'})
603100TFif (exists $args{'Id'})
604100TFif ($args{'NoProlog'})
605100TFif ($args{'DoNotOutputDTD'})
606100TFif ($args{'LoadDTD'})
607100TFif ($args{'CharHandler'})
609100TFif ($args{'InputFilter'})
610100TFif ($args{'NoExpand'})
611100TFif (my $output_encoding = $args{'OutputEncoding'})
613100TFif (my $tdh = $args{'TopDownHandlers'})
616100TFif ($$self{'twig_roots'}) { }
617100TFif ($$self{'twig_default_print'}) { }
618100TFif ($$self{'twig_keep_encoding'}) { }
643100TFif ($weakrefs)
652100TFif (not ref $t or not isa($t, 'XML::Twig'))
65750TFif ($] >= 5.008 and ${^UNICODE} and ${^UNICODE} & 24 and isa($_[0], 'GLOB') and -p $_[0])
674100TFif (not $t)
675100TFif (isa($returned, 'XML::Twig') and $$returned{'twig_finish_now'}) { }
69850TFunless _use('File::Temp')
70650TFunless ($$t{'twig_keep_encoding'} or $] < 5.006)
71350TFunless chmod $mode, $tmpfile
715100TFif ($suffix)
717100TFif ($suffix =~ /\*/) { }
72050TFunless rename $file, $backup
72250TFunless rename $tmpfile, $file
74150TF$@ ? :
74650TFunless _use('LWP::Simple')
74850TF$@ ? :
75550TF$@ ? :
761100TF$$t{'ErrorContext'} ? :
77050TF$$t{'ErrorContext'} ? :
772100TFisa($content, 'GLOB') ? :
779100TFif (isa($to_parse, 'GLOB')) { }
100TFelsif ($to_parse =~ /^\s*</) { }
100TFelsif ($to_parse =~ m[^\w+://.*\.html?$]) { }
100TFelsif ($to_parse =~ m[^\w+://]) { }
100TFelsif ($to_parse =~ /\.html?$/) { }
780100TF$to_parse =~ /<html/i ? :
783100TFunless _use('LWP::Simple')
786100TFunless _use('LWP::Simple')
78950TFif ($xml_parse_ok) { }
7930TFif ($doc =~ /<html/i) { }
807100TFif (_is_well_formed_xml($_[0])) { }
811100TFif (_is_well_formed_xml($html)) { }
822100TF$@ ? :
839100TFunless _use('HTML::TreeBuilder', '3.13')
852100TFif ($$options{'indent'})
86750TFif ($@ =~ /^\s*xml declaration not at start of external entity/) { }
50TFelsif ($@ =~ /^\s*not well-formed \(invalid token\)/) { }
873100TFunless (keys %xml_parser_encoding)
875100TFif (not $add_decl) { }
87650TFif ($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'}) { }
88350TFif ($add_decl) { }
92250TFif ($$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)
93650TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
9400TFif ($converter)
96750TFif ($2 and $block_tag{$2}) { }
0TFelsif ($3 and $block_tag{$3}) { }
96850TFunless $2 =~ m[/>]
986100TFif ($text_type{$type}) { }
1011100TFif ($disallowed{$module})
1012100TFif ($used{$module})
1013100TFif (eval "require $module") { }
101550TFif (${"${module}::VERSION";} >= $version) { }
1027100TFif ($n > 0) { }
100TFelsif ($n < 0) { }
1028100TFif $i == $n
100TFif (&$coderef)
1030100TFif $i == $n
100TFif (&$coderef)
1038100TFif ($uri =~ m[^\w+://]) { }
1045100TFif (defined $base and not $filename =~ m[^(?:[\\/]|\w+:)])
1056100TFunless open TWIG_TO_SLURP, "<$filename"
107950TFunless _use('LWP')
108050TFif ($^O ne 'VMS') { }
108150TFunless pipe README, WRITEME
1082100TFif (my $pid = fork) { }
1085100TF$safe ? :
1087100TF$@ ? :
1099100TFunless $response->is_success
11090TFunless $response->is_success
11100TF$safe ? :
11110TF$@ ? :
1135100TFif ($$t{'twig_keep_encoding'})
114350TFif (@saved_default_handler and defined $saved_default_handler[1]) { }
1157100TFif ($$p{'twig'}{'twig_doctype'}{'has_internal'} and not $expat_1_95_2)
1172100TFunless $_[0]
100TFif isa($_[0], 'GLOB') or isa($_[0], 'IO::Scalar')
1179100TFunless _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)
1197100TFif ($path =~ /^\s*($ALL|$DEFAULT|#COMMENT)\s*$/io) { }
1207100TFif (my $handler_data = _parse_xpath_handler($path, $handler)) { }
1219100TF$$handlers{'xpath_handler'}{$tag} ? :
1221100TFif ($prev_handler)
1223100TFif $$handler_data{'handler'}
1226100TFunless ($$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)
1241100TFif ($path =~ /^\s*(?:\?|#PI)\s*(?:([^\s]*)\s*)$/) { }
1255100TFif ($path =~ /^ \s* level \s* \( \s* ([0-9]+) \s* \) \s* $/ox) { }
1271100TFif ($path =~ /^\(\?([xism]*)(?:-[xism]*)?:(.*)\)$/) { }
129050TFif ($DEBUG_HANDLER >= 1)
129450TFif ($DEBUG_HANDLER and $path_to_check =~ /\S/)
1295100TFif $path_to_check =~ /\S/
1311100TFif ($2) { }
1312100TFif ($last_token_is_sep)
1316100TFif (defined $last_token_is_sep and not $last_token_is_sep)
1322100TFif ($last_token_is_sep)
1336100TF$xpath_original =~ m[^\s*/(?!/)] ? :
134550TF$DEBUG_HANDLER >= 2 ? :
1347100TFif ($predicate)
134850TFif ($DEBUG_HANDLER >= 2)
135150TFif ($DEBUG_HANDLER >= 2)
1354100TF$tag ne '*' ? :
1360100TFif ($sep eq '/') { }
50TFelsif ($sep eq '//') { }
138850TF$DEBUG_HANDLER >= 2 ? :
1399100TFif ($anchored)
140150TF$DEBUG_HANDLER >= 2 ? :
140550TFif $DEBUG_HANDLER >= 2
140750TFif $DEBUG_HANDLER >= 1
140950TFif ($@)
141250TFif $DEBUG_HANDLER >= 1
141350TFif $DEBUG_HANDLER >= 1
1429100TFif ($func or $string_regexp or $string_test_num or $string_test_alpha)
1431100TFif (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) { }
1432100TF$att =~ /^#/ ? :
1435100TF$bare_att =~ /^#/ ? :
14470TF$2 eq '=' ? :
14500TF$and_or eq 'and' ? :
148550TFif $$handlers{'attcond_handlers'}
1565100TFif isa($$handlers{$path}, 'CODE')
1575100TFif (my $type = $$handler_data{'test_on_text'})
1590100TFif ($$t{'twig_parsing'})
1594100TFif ($weakrefs)
1611100TF$@ ? :
1617100TF$@ ? :
1631100TFif $t->root
1640100TFunless $$t{'twig_current'}
1641100TFif ($$t{'twig_stored_spaces'} or $option{'force'} or $$t{'twig_preserve_space'})
1642100TFif ($$t{'twig_current'}->is_pcdata) { }
1646100TFunless (defined $$t{'twig_space_policy'}{$current_gi})
1649100TFif ($$t{'twig_space_policy'}{$current_gi} or not $$t{'twig_stored_spaces'} =~ /\n/ or $option{'force'} or $$t{'twig_preserve_space'})
1674100TFif ($$t{'twig_in_pcdata'})
1681100TFif (my $func = $$t{'parse_start_tag'}) { }
50TFelsif ($$t{'twig_entities_in_attribute'}) { }
1690100TFif ($$t{'twig_read_external_dtd'})
1693100TFif (my $filter = $$t{'twig_input_filter'})
1698100TFif ($$t{'twig_map_xmlns'})
1705100TFif ($weakrefs)
1708100TFif $parent
1712100TFif ($parent) { }
1714100TFif ($prev_sibling)
1716100TFif ($weakrefs)
1719100TFif ($weakrefs)
1720100TFunless ($$parent{'first_child'})
1721100TFif ($weakrefs)
172750TFif defined $$t{'twig_dtd_handler'}
1732100TFif ($$t{'twig_default_print'}) { }
100TFelsif ($$t{'twig_roots'}) { }
1740100TF$p->recognized_string =~ m[/\s*>$]s ? :
1742100TFif $$t{'extra_data'}
1747100TFif (defined $id)
1749100TFif ($weakrefs)
1753100TFif ($$t{'twig_starttag_handlers'})
1760100TFunless &$handler($t, $elt)
1762100TFif (my $all = $$t{'twig_starttag_handlers'}{'handlers'}{$ALL})
1767100TFif ($$t{'twig_ignore_elts_handlers'})
1770100TFif (@handlers)
1773100TFif ($$elt{'att'}{'xml:space'} and $$elt{'att'}{'xml:space'} eq 'preserve')
1783100TFif (not $$t{'twig_keep_original_prefix'} and my $mapped_prefix = $$t{'twig_map_xmlns'}{$uri})
1786100TFif ($new_prefix eq '#default') { }
1792100TFif ($$t{'twig_keep_original_prefix'}) { }
1797100TFif ($$ns_info{'mapped_prefix'})
1803100TFif ($att_name) { }
1806100TFif ($$ns_info{'mapped_prefix'})
1815100TFif $map_att
1821100TFif ($att_name) { }
1836100TFunless $$ns_info{'uri'}
1847100TFif ($p->expand_ns_prefix($prefix) eq $uri)
1859100TFif (not exists $value{$att} and exists $$attlist{$att}{'default'} and $$attlist{$att}{'default'} ne '#IMPLIED')
1881100TFif ($string =~ s[^<\s*($REG_NAME)\s*[\s>/]][]s) { }
1894100TFif ($weakrefs)
1904100TFif ($$t{'twig_map_xmlns'})
1913100TFif ($$t{'twig_in_pcdata'})
191550TFif $$elt{'parent'}
1921100TFif $parent
1925100TFif ($$parent{'twig_to_be_normalized'})
1927100TFif ($$t{'extra_data'})
1930100TFif ($$t{'twig_handlers'})
1934100TFif ($$t{'twig_tdh'}) { }
1935100TFif (@handlers)
1936100TFif (my $all = $$t{'twig_handlers'}{'handlers'}{$ALL})
1944100TFunless &$handler($t, $elt)
1946100TFif (my $all = $$t{'twig_handlers'}{'handlers'}{$ALL})
1952100TFif ($$t{'twig_root_depth'} and $p->depth == $$t{'twig_root_depth'})
1953100TFif ($$t{'twig_default_print'}) { }
1956100TFif ($$t{'twig_keep_encoding'}) { }
1965100TFif ($$elt{'att'}{'xml:space'} and $$elt{'att'}{'xml:space'} eq 'preserve')
197450TFif (@{$$t{'twig_handlers_to_trigger'};})
197950TFunless &$handler($t, $handled_elt)
2003100TFif (my $found_path = &$trigger($$t{'_twig_context_stack'}))
2010100TFif (not @found_handlers and defined $$handlers{'handlers'}{$DEFAULT})
2013100TFif (@found_handlers and $$t{'twig_do_not_chain_handlers'})
2027100TFif (not $uri and not $name =~ /^xml/)
2028100TFif ($uri) { }
2029100TFif (my $mapped_prefix = $$t{'twig_map_xmlns'}{$uri}) { }
2033100TFif ($prefix eq '#default')
2034100TF$prefix ? :
2048100TFif ($$t{'twig_keep_encoding'})
2049100TFif (not $$t{'twig_in_cdata'}) { }
2054100TFif (length $string < 1024) { }
2064100TFif ($$t{'twig_input_filter'})
2067100TFif ($$t{'twig_char_handler'})
2072100TFif ($$t{'twig_in_cdata'}) { }
100TFelsif ($$t{'twig_in_pcdata'}) { }
2078100TFif ($$t{'extra_data'})
2086100TFif ($string =~ /\A\s*\Z/s) { }
2087100TFif ($$t{'extra_data'}) { }
2102100TFif ($$t{'extra_data'})
2121100TFif ($$t{'twig_in_pcdata'}) { }
212350TFif ($weakrefs)
212650TFif ($weakrefs)
212750TFif ($weakrefs)
2132100TFif ($t->_space_policy($XML::Twig::index2gi[$$twig_current{'gi'}]) and $$t{'twig_stored_spaces'})
213750TFif ($weakrefs)
2138100TFif (my $prev_sibling = $$twig_current{'last_child'}) { }
213950TFif ($weakrefs)
214450TFif ($weakrefs)
2151100TFif ($$t{'extra_data'})
2170100TFif ($$t{'twig_handlers'})
2174100TFunless &$handler($t, $elt)
219150TFunless &$handler($t, $pi)
100TFif ($handler)
2196100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{$target})
2198100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{''})
2200100TFdefined $data && $data ne '' ? :
2205100TFif (my $handler = $$t{'twig_handlers'}{'handlers'}{'#COMMENT'})
2211100TFif (my $handler = $$t{'twig_handlers'}{'handlers'}{'#COMMENT'})
2213100TFif (not defined $comment or $comment eq '')
2226100TFif ($$t{'twig_keep_encoding'})
2240100TFif ($$t{'twig_keep_encoding'})
2254100TFif ($$t{'twig_input_filter'})
2258100TFif ($keep) { }
100TFelsif ($process) { }
2260100TFif ($$t{'twig_stored_spaces'})
2275100TFif ($$t{'extra_data'})
2280100TFif (not $t->root) { }
100TFelsif ($$t{'twig_in_pcdata'}) { }
100TFelsif ($twig_current) { }
2290100TFif ($t->_space_policy($XML::Twig::index2gi[$$twig_current{'gi'}]) and $$t{'twig_stored_spaces'})
2299100TFif ($twig_current)
2325100TF$p->isa('XML::Twig') ? :
2328100TFif ($$t{'extra_data'})
2333100TFif $$t{'twig_tdh'}
2335100TFif $$t{'twig_original_selected_fh'}
2337100TFif (exists $$t{'twig_autoflush_data'})
2339100TFif $$t{'twig_autoflush_data'}{'fh'}
2340100TFif $$t{'twig_autoflush_data'}{'args'}
2362100TFif ($prev_sibling) { }
236450TFif ($weakrefs)
2369100TFif ($weakrefs)
2370100TFif ($weakrefs)
2378100TFif $$t{'twig_discard_spaces'}
2379100TFif $$t{'twig_keep_spaces'}
2380100TFif $$t{'twig_keep_spaces_in'} and $$t{'twig_keep_spaces_in'}{$gi}
2382100TFif $$t{'twig_discard_spaces_in'} and $$t{'twig_discard_spaces_in'}{$gi}
2398100TFif ($sysid)
2399100TFif ($ndata) { }
2400100TFif (not -f _based_filename($sysid, $p->base))
2403100TFif ($$t{'twig_expand_external_ents'})
2405100TFif (not defined $val)
2406100TFif ($$t{'twig_extern_ent_nofail'}) { }
2416100TFif ($missing_entity)
241950TFif ($entity_list)
242150TFif ($parser_version > 2.27)
2425100TFif ($$t{'twig_keep_encoding'})
242650TFif (defined $$ent{'val'} and not $ent_decl =~ /["']/)
24280TF$val =~ /"/ ? :
243350TFunless $$t{'twig_doctype'}{'internal'} =~ /<!ENTITY\s+$name\s+/
244550TFif ($$t{'twig_no_expand'})
24460TF$$t{'twig_keep_encoding'} ? :
2451100TFif (not defined $ent_content)
245650TFif ($$t{'twig_extern_ent_nofail'}) { }
249150TFif ($parser_version > 2.27) { }
2507100TFif ($$t{'twig_read_external_dtd'} and $sysid)
251650TFif $t_dtd->entity_list
253250TFif ($parser_version > 2.27 and $$t{'twig_doctype'}{'internal'} =~ /(^|>)\s*$/)
253350TF$XML::Twig::Elt::keep_encoding ? :
253450TFunless ($text)
255350TFif ($parser_version > 2.27 and $$t{'twig_doctype'}{'internal'} =~ /(^|>)\s*$/)
255450TF$XML::Twig::Elt::keep_encoding ? :
255550TFunless ($text)
2559100TFif $fixed
256050TFif defined $default
2562100TFif ($$t{'twig_dtd'}{'att'}{$gi}) { }
257550TFif defined $default
2588100TFunless $string =~ /^&([^;]*);$/
259050TFif ($p->original_string =~ /^</ and $p->original_string =~ />$/) { }
25920TFif $$t{'twig_do_not_escape_amp_in_atts'}
2596100TFif ($$t{'twig_keep_encoding'}) { }
2619100TFif ($$t{'twig_in_pcdata'}) { }
262250TFif ($weakrefs)
262550TFif ($weakrefs)
262650TFif ($weakrefs)
263550TFif ($weakrefs)
2636100TFif (my $prev_sibling = $$twig_current{'last_child'}) { }
263750TFif ($weakrefs)
264150TFif ($twig_current)
264250TFif ($weakrefs)
50TFif ($twig_current)
2658100TFunless $$t{'twig_xmldecl'} or $$t{'output_encoding'}
2661100TFif ($decl) { }
2668100TFif ($$t{'output_encoding'}) { }
100TFelsif ($$decl{'encoding'}) { }
2677100TFif (defined $$decl{'standalone'})
2679100TF$$decl{'standalone'} ? :
2691100TF$output_filter ? :
2696100TFunless defined $$t{'twig_doctype'}
269850TFif defined $name
2699100TFif defined $system
2700100TFif defined $public
2701100TFif defined $internal
2706100TFunless my $doctype = $$t{'twig_doctype'}
2712100TFunless my $doctype = $$t{'twig_doctype'}
2718100TFunless my $doctype = $$t{'twig_doctype'}
2724100TFunless my $doctype = $$t{'twig_doctype'}
2738100TFif $elt
276550TF_is_fh($_[0]) ? :
2772100TFif ($$t{'no_prolog'})
2774100TFdefined $$t{'no_dtd_output'} ? :
50TF$$t{'no_prolog'} ? :
2787100TFif ($doctype)
278850TFif $$doctype{'name'}
2789100TFif $$doctype{'pub'}
2790100TFif $$doctype{'sysid'} and not $$doctype{'pub'}
2791100TFif $$doctype{'sysid'}
2794100TFif ($update_dtd) { }
100TFelsif ($doctype) { }
2795100TFif ($doctype) { }
50TFelsif (not $$t{'twig_dtd'} and keys %{$t->entity_list;}) { }
2798100TFif ($internal)
280350TFif $t->entity_list
2804100TFif ($internal)
2814100TFif (my $internal = $$doctype{'internal'})
2826100TFif ($doctype_text) { }
283350TF$output_filter ? :
2858100TFunless open TWIG_PRINT_TO_FILE, ">$filename"
285950TFif ($] > 5.006 and not $$t{'twig_keep_encoding'})
2867100TF_is_fh($_[0]) ? :
2870100TFdefined $fh ? :
2871100TFdefined $args{'PrettyPrint'} ? :
2872100TFdefined $args{'EmptyTags'} ? :
2881100TFif defined $old_pretty
2882100TFif defined $old_empty_tag
2883100TFif ($fh)
289250TFif $$t{'twig_tdh'}
2894100TFif $$t{'twig_completely_flushed'}
2896100TF_is_fh($_[0]) ? :
2897100TFdefined $fh ? :
2898100TFref $_[0] ? :
2902100TFif (defined $args{'PrettyPrint'})
2908100TFif ($args{'EmptyTags'})
2917100TFif ($up_to) { }
100TFelsif ($$t{'twig_current'}) { }
2929100TFunless ($elt->_flushed)
2931100TFif ($$t{'twig_autoflush'})
2933100TFif $fh
2934100TFif @_
2942100TFif ($last_elt and $last_elt->in($elt)) { }
2944100TFunless ($elt->_flushed)
2956100TFif $last_elt and $elt == $last_elt
2961100TFif ($flush_trailing_data)
2966100TFif defined $old_select
2967100TFif defined $old_pretty
2968100TFif defined $old_empty_tag_style
2979100TFif (_is_fh($_[0])) { }
2996100TFif (defined $args{'PrettyPrint'})
3002100TFif (defined $args{'EmptyTags'})
3014100TFif defined $old_pretty
3015100TFif defined $old_empty_tag_style
302950TFif $$t{'twig_tdh'}
3033100TFif ($up_to) { }
100TFelsif ($$t{'twig_current'}) { }
3044100TFif ($last_elt and $last_elt->in($elt)) { }
3052100TFif $last_elt and $elt == $last_elt
307650TFif $] < 5.006
3079100TFref $twig_or_class ? :
3084100TFif $elt_class->can($att) and not $accessor{$att}
3087100TFif (not $accessor{$att})
3091100TFif (@_)
3105100TFif $root->passes($cond)
3117100TFif $t->root->matches($cond)
3123100TFif (isa($_[0], 'ARRAY')) { }
3136100TFunless @unique and $unique[-1] == $current
3142100TFif (isa($_[0], 'ARRAY')) { }
3159100TFdefined $index ? :
3167100TFif (not $cond && !$root->passes($cond)) { }
3186100TFif ($root->passes($cond)) { }
3221100TFunless $index = $XML::Twig::gi2index{$old_gi}
323350TFunless my $doctype = $$t{'twig_doctype'}
3240100TFif ($$dtd{'att'}{$gi})
3245100TFif ($$attlist{$att}{'fixed'}) { }
325450TFif $t->entity_list
3262100TF_is_fh($_[0]) ? :
3263100TFif ($fh) { }
3280100TFunless $$t{'twig_parsing'}
328850TFif ($$t{'twig_map_xmlns'}) { }
3303100TFif (not defined $fh) { }
50TFelsif (defined $fh) { }
330750TFif $old_fh
3311100TFif ($$t{'twig_keep_encoding'}) { }
3329100TFif (not $input_filter or isa($input_filter, 'CODE')) { }
50TFelsif ($input_filter eq 'latin1') { }
50TFelsif ($filter{$input_filter}) { }
338950TFif ($$t{'twig_root'} and isa($$t{'twig_root'}, 'XML::Twig'))
3394100TFif $$t{'twig_root'}
341450TFif ($string eq '<!DOCTYPE') { }
343050TFif ($expat_1_95_2 and $p->recognized_string eq '[' and not $$p{'twig'}{'expat_1_95_2_seen_bracket'}) { }
345450TFif ($string eq '<!DOCTYPE') { }
347750TFif ($name)
348150TFif $name
348250TFif $pubid
3483100TFif $sysid and not $pubid
3484100TFif $sysid
3485100TFif $internal and not $expat_1_95_2
3486100TFunless $internal or $expat_1_95_2
349750TFif ($name)
350150TFif $name
350250TFif $pubid
3503100TFif $sysid and not $pubid
3504100TFif $sysid
3505100TFif $internal
3506100TFunless $internal or $expat_1_95_2
3539100TFunless ($p->depth == 0)
3540100TFif ($$t{'twig_map_xmlns'})
3546100TFif (_handler($t, $$t{'twig_roots'}, $gi, \%att))
3555100TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3559100TFif ($p->depth == 0) { }
100TFelsif ($$t{'twig_starttag_handlers'}) { }
3561100TFif $tag
357350TFunless $last_handler_res
3576100TFif $tag and !@handlers || $last_handler_res
3580100TFif $tag
3591100TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3596100TFif ($$t{'twig_endtag_handlers'})
360250TFif (not $last_handler_res)
3609100TFif defined $tag
3611100TFif ($p->depth == 0)
362550TF$$t{'twig_keep_encoding'} ? :
100TF$$t{'twig_default_print'} ? :
3630100TFif (my $handler = $$t{'twig_handlers'}{'pi_handlers'}{$target} || $$t{'twig_handlers'}{'pi_handlers'}{''}) { }
364250TFif defined $pi
365550TFif ($action eq 'print')
366950TFif ($action eq 'print')
3676100TFif (not $$t{'twig_ignore_level'})
3690100TFif ($$t{'twig_endtag_handlers'})
3708100TFif (not $elt && isa($elt, 'XML::Twig::Elt'))
3714100TFunless ($elt == $current or $$current{'last_child'} and $elt == $$current{'last_child'} or $current->in($elt))
3717100TF$current == $elt ? :
372650TFif ($action eq 'print')
3741100TFif ($$elt_in_stack{'_elt'} and $elt == $$elt_in_stack{'_elt'})
3752100TFif ($output_fh and not $$t{'twig_output_fh_selected'})
3764100TFunless $$t{'twig_output_fh'}
377350TFif $_[0]{'twig_xmldecl'}
377850TFunless $t->xml_version
3790100TFif ($encoding and not $encoding =~ /^utf-?8$/i or $$t{'twig_keep_encoding'} or $output_filter)
379750TFif $_[0]{'twig_xmldecl'}
380650TFif $_[0]{'twig_xmldecl'}
381150TFunless $t->xml_version
3819100TFif defined $_[0]{'twig_parser'}
3826100TFif defined $_[0]{'twig_parser'}
3836100TFif (my $start_document = $handler->can('start_document'))
384150TFif ($t->root)
384250TFif (my $end_document = $handler->can('end_document'))
3864100TFif ($$t{'twig_current'}) { }
3870100TFunless ($elt->_flushed)
387250TFif (my $start_document = $handler->can('start_document'))
3880100TFif ($last_elt and $last_elt->in($elt)) { }
3882100TFunless ($elt->_flushed)
388450TFif (my $start_element = $handler->can('start_element'))
388550TFif (my $tag_data = &$start_tag_data($elt))
3897100TFif $last_elt and $elt == $last_elt
3901100TFif (not $$t{'twig_parsing'})
390250TFif (my $end_document = $handler->can('end_document'))
3921100TFif (my $xml_decl = $handler->can('xml_decl'))
3928100TFunless $doctype
393450TFif (my $start_dtd = $handler->can('start_dtd'))
393950TFif (my $end_dtd = $handler->can('end_dtd'))
394750TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
396150TFif (_use('Encode')) { }
0TFelsif (_use('Text::Iconv')) { }
0TFelsif (_use('Unicode::Map8') and _use('Unicode::String')) { }
398550TFunless _use('HTML::Entities')
399150TFif ($] < 5.008) { }
400350TFif ($] < 5.008) { }
402050TFif ($len == 2) { }
0TFelsif ($len == 3) { }
0TFelsif ($len == 4) { }
0TFelsif ($len == 1) { }
4038100TF$hex ? :
404450TF$_[1] ? :
404550TFunless _use('Unicode::Map8')
404650TFunless _use('Unicode::String')
405650TFunless ($sub)
406150TF$_[1] ? :
406250TFunless _use('Text::Iconv')
4071100TFunless ($sub)
407250TFif ($@ =~ /^Unsupported conversion: Invalid argument/) { }
408250TF$_[1] ? :
408450TFunless $sub
4092100TFwantarray ? :
410250TFif ($t->root)
4134100TFunless $ents_to_add and %$ents_to_add
4155100TFif (isa(ref $_[0], 'XML::Twig::Entity')) { }
417150TFdefined $fh ? :
417650TFif (isa($ent, 'XML::Twig::Entity'))
417850TFif defined $old_select
4213100TFif defined $val
4214100TFif defined $sysid
4215100TFif defined $pubid
4216100TFif defined $ndata
4217100TFif defined $param
4226100TFdefined $_[0]{'sysid'} ? :
422750TFdefined $_[0]{'pubid'} ? :
4228100TFdefined $_[0]{'ndata'} ? :
4229100TFdefined $_[0]{'param'} ? :
423550TFif (not defined $text)
423650TFif ($fh) { }
424350TFif (not defined $text)
4249100TFif not $$ent{'name'}
4253100TFif $$ent{'param'}
4256100TFif (defined $$ent{'val'} and not defined $$ent{'sysid'} and not defined $$ent{'pubid'}) { }
50TFelsif (defined $$ent{'sysid'}) { }
4260100TFif $$ent{'pubid'}
4261100TFunless $$ent{'pubid'}
4263100TFif $$ent{'ndata'}
426950TF$_[0] =~ /"/ ? :
436950TFif (eval 'require Scalar::Util' and defined &Scalar::Util::weaken) { }
0TFelsif (eval 'require WeakRef') { }
4388100TFunless @_
4395100TFref $_[0] eq 'HASH' ? :
4397100TFif ($atts and defined $$atts{'#CDATA'})
4404100TFif ($gi eq '#PCDATA') { }
100TFelsif ($gi eq '#ENT') { }
100TFelsif ($gi eq '#CDATA') { }
100TFelsif ($gi eq '#COMMENT') { }
100TFelsif ($gi eq '#PI') { }
4405100TFif (grep {ref $_;} @_)
4411100TFif (grep {ref $_;} @_)
4415100TFif (grep {ref $_;} @_)
4419100TFif (grep {ref $_;} @_)
4424100TFif (@_) { }
4430100TFif ($atts)
4432100TFif (defined $$atts{'#ASIS'})
4433100TFif (defined $$atts{'#EMPTY'})
4434100TFif (keys %$atts)
4435100TFif $$atts{$ID}
4448100TFif (ref $class)
4457100TFif ($$t{'twig_id_list'})
4474100TFif ($elt->tag eq 'head') { }
100TFelsif ($elt->tag ne 'html') { }
4491100TFunless (defined $XML::Twig::gi2index{$gi})
4515100TFif ($qname =~ /^([^:]*):/) { }
4536100TFdefined $_[0] ? :
4537100TF$prefix ? :
45470TFif (my $prefix = $elt->ns_prefix)
45490TFif (not $missing_prefix{$prefix} and not $elt->namespace)
45540TFif (not $root->_inherits_declared_prefix($prefix))
45650TFif ($elt->_declares_prefix($prefix)) { }
45750TFif $att eq "xmlns:$prefix"
45810TF$prefix ? :
45890TFif ($elt->_ns_prefix and $elt->namespace eq $uri)
4599100TFif $gi_nb >= $XML::Twig::SPECIAL_GI
4605100TFif ($_[0]{'gi'} >= $XML::Twig::SPECIAL_GI) { }
464750TFdefined $_[1] ? :
465050TFif $_[0]{'empty'} or 0
4658100TFif (exists $$descendant{'cdata'})
467050TFif $$descendant{'asis'}
4681100TFunless $curr_elt
4688100TFif ($elt->_extra_data_in_pcdata)
4707100TFif ($$elt{'extra_data_before_end_tag'}) { }
4723100TFif ((my $offset = index($modified, $initial)) != -1) { }
100TFelsif (($offset = index($initial, $modified)) != -1) { }
4731100TFif $$_{'offset'} >= 0
4734100TFunless _match_extra_data_words($elt, $initial, $modified) or _match_extra_data_chars($elt, $initial, $modified)
4761100TFif (@$initial <= @$modified) { }
4764100TFif ($ok)
4779100TFif ($ok)
479350TFif ($$cpi{'offset'} < $prev_pos)
4810100TFif ($s_word ne $l_word)
4815100TFif (not @$long and $s_word ne $l_word)
486150TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#PI'})
487650TFif (defined $data and $data ne '')
4883100TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#COMMENT'})
4900100TFunless ($$elt{'gi'} == $XML::Twig::gi2index{'#CDATA'})
4923100TFunless $elt->is_elt
4925100TFif $child->is_elt
4933100TFunless $child->is($exp)
4939100TFunless my $child = $$elt{'first_child'}
4940100TFunless $child->passes($exp)
4941100TFif $$child{'next_sibling'}
4994100TF$cond =~ s/^\s*!// ? :
4996100TFif (ref $cond eq 'CODE')
4998100TFif (ref $cond eq 'Regexp') { }
5002100TFif ($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*$/) { }
5008100TFif ($1 ne '*') { }
5012100TFif ($gi) { }
5034100TF$neg ? :
5035100TFif ($gi and $gi ne '*') { }
5047100TF$tag && $tag ne '*' ? :
5061100TFif ($@)
5075100TFif (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) { }
5084100TF$and_or eq 'and' ? :
5111100TFif ($op eq '=') { }
100TFelsif ($op eq '!=') { }
5118100TFunless $cond
51260TFif ($XML::Twig::weakrefs)
5165100TFif ($child) { }
5168100TFif ($cond =~ /^\s*($REG_NAME)/) { }
518150TFif ($XML::Twig::weakrefs)
51970TFif ($XML::Twig::weakrefs)
5229100TFunless $new_class
523150TF$class ? :
5247100TFunless $elt->tag eq 'span' and $elt->class
5253100TFunless $elt->tag eq 'div' and $elt->class
526050TFunless defined $elt_class
5261100TF$elt->class =~ /(?:^|\s)\Q$class\E(?:\s|$)/ ? :
5270100TFif keep_atts_order()
5271100TFisa($_[0] || '', 'HASH') ? :
5273100TFif (exists $atts{$ID})
5285100TFif ($_[0] and ref $_[0] and not $_[1])
5288100TFunless ($$elt{'att'})
5290100TFif keep_atts_order()
5296100TFif ($att eq $ID)
5318100TFunless defined $value
53270TFif ($att ne lc $att)
5338100TFif exists $$elt{'att'}{$ID}
5349100TFif ($XML::Twig::weakrefs)
5365100TFif (defined $$elt{'att'}{$ID}) { }
536850TF$_[0] && isa($_[0], 'CODE') ? :
537750TFunless (exists $$elt{'att'})
5378100TFunless (exists $$elt{'att'}{$ID})
5384100TFunless ($t)
538550TFif (exists $$t{'twig_id_list'}{$id})
5431100TFif $child->passes($cond)
5440100TFwantarray ? :
5447100TFwantarray ? :
5454100TFunless $child->passes($cond)
5464100TFif $elt->passes($cond)
5473100TFif $elt->passes($cond)
5482100TF$include_self ? :
5494100TFif (defined $$elt{'att'}{$att} and !%tags || $tags{$XML::Twig::index2gi[$$elt{'gi'}]})
5508100TFif (defined $$elt{'att'}{$att} and !%tags || $tags{$XML::Twig::index2gi[$$elt{'gi'}]})
5520100TFif $elt->namespace('')
5542100TFif defined $_[0] and isa($_[0], 'XML::Twig::Elt')
5548100TFif ($cond)
5549100TFunless (defined($ind = $XML::Twig::gi2index{$cond}))
5554100TFif ($next_elt = $$elt{'first_child'}) { }
100TFelsif ($next_elt = $$elt{'next_sibling'}) { }
5561100TFif $subtree_root and $elt == $subtree_root
5569100TFif $subtree_root and $elt == $subtree_root
5574100TFif $subtree_root and $subtree_root == $next_elt
5577100TFif $subtree_root and $subtree_root == $next_elt
5598100TFif (not $cond or $last_descendant->matches($cond)) { }
5619100TFif (defined $_[0] and isa($_[0], 'XML::Twig::Elt'))
5621100TFif $elt == $subtree_root
5627100TFif $elt == $subtree_root
5628100TFif ($prev_elt = $$elt{'prev_sibling'}) { }
5644100TF$elt ? :
5650100TFif not $cond or $elt->matches($cond)
5656100TFif (not $cond)
5658100TFif ($following) { }
5672100TF$elt ? :
5678100TFif not $cond or $elt->matches($cond)
5684100TFif (not $cond)
5686100TFif ($preceding) { }
5699100TF$cond ? :
5713100TFif (isa($ancestor, 'XML::Twig::Elt')) { }
5715100TFif $elt == $ancestor
5719100TFif $elt->matches($ancestor)
5726100TFunless my $dest = $elt->first_child(@_)
5737100T