Server IP : 103.119.228.120 / Your IP : 3.148.117.237 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "XML::LibXML::InputCallback 3" .TH XML::LibXML::InputCallback 3 "2016-07-24" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::LibXML::InputCallback \- XML::LibXML Class for Input Callbacks .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use XML::LibXML; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" You may get unexpected results if you are trying to load external documents during libxml2 parsing if the location of the resource is not a \s-1HTTP, FTP\s0 or relative location but a absolute path for example. To get around this limitation, you may add your own input handler to open, read and close particular types of locations or \s-1URI\s0 classes. Using this input callback handlers, you can handle your own custom \s-1URI\s0 schemes for example. .PP The input callbacks are used whenever LibXML has to get something other than externally parsed entities from somewhere. They are implemented using a callback stack on the Perl layer in analogy to libxml2's native callback stack. .PP The XML::LibXML::InputCallback class transparently registers the input callbacks for the libxml2's parser processes. .SS "How does XML::LibXML::InputCallback work?" .IX Subsection "How does XML::LibXML::InputCallback work?" The libxml2 library offers a callback implementation as global functions only. To work-around the troubles resulting in having only global callbacks \- for example, if the same global callback stack is manipulated by different applications running together in a single Apache Web-server environment \-, XML::LibXML::InputCallback comes with a object-oriented and a function-oriented part. .PP Using the function-oriented part the global callback stack of libxml2 can be manipulated. Those functions can be used as interface to the callbacks on the C\- and \s-1XS\s0 Layer. At the object-oriented part, operations for working with the \&\*(L"pseudo-localized\*(R" callback stack are implemented. Currently, you can register and de-register callbacks on the Perl layer and initialize them on a per parser basis. .PP \fICallback Groups\fR .IX Subsection "Callback Groups" .PP The libxml2 input callbacks come in groups. One group contains a \s-1URI\s0 matcher (\fImatch\fR), a data stream constructor (\fIopen\fR), a data stream reader (\fIread\fR), and a data stream destructor (\fIclose\fR). The callbacks can be manipulated on a per group basis only. .PP \fIThe Parser Process\fR .IX Subsection "The Parser Process" .PP The parser process works on an \s-1XML\s0 data stream, along which, links to other resources can be embedded. This can be links to external DTDs or XIncludes for example. Those resources are identified by URIs. The callback implementation of libxml2 assumes that one callback group can handle a certain amount of URIs and a certain \s-1URI\s0 scheme. Per default, callback handlers for \fIfile://*\fR, \fIfile:://*.gz\fR, \fIhttp://*\fR and \fIftp://*\fR are registered. .PP Callback groups in the callback stack are processed from top to bottom, meaning that callback groups registered later will be processed before the earlier registered ones. .PP While parsing the data stream, the libxml2 parser checks if a registered callback group will handle a \s-1URI \-\s0 if they will not, the \s-1URI\s0 will be interpreted as \fIfile://URI\fR. To handle a \s-1URI,\s0 the \fImatch\fR callback will have to return '1'. If that happens, the handling of the \s-1URI\s0 will be passed to that callback group. Next, the \s-1URI\s0 will be passed to the \fIopen\fR callback, which should return a \fIreference\fR to the data stream if it successfully opened the file, '0' otherwise. If opening the stream was successful, the \fIread\fR callback will be called repeatedly until it returns an empty string. After the read callback, the \fIclose\fR callback will be called to close the stream. .PP \fIOrganisation of callback groups in XML::LibXML::InputCallback\fR .IX Subsection "Organisation of callback groups in XML::LibXML::InputCallback" .PP Callback groups are implemented as a stack (Array), each entry holds a reference to an array of the callbacks. For the libxml2 library, the XML::LibXML::InputCallback callback implementation appears as one single callback group. The Perl implementation however allows one to manage different callback stacks on a per libxml2\-parser basis. .SS "Using XML::LibXML::InputCallback" .IX Subsection "Using XML::LibXML::InputCallback" After object instantiation using the parameter-less constructor, you can register callback groups. .PP .Vb 7 \& my $input_callbacks = XML::LibXML::InputCallback\->new(); \& $input_callbacks\->register_callbacks([ $match_cb1, $open_cb1, \& $read_cb1, $close_cb1 ] ); \& $input_callbacks\->register_callbacks([ $match_cb2, $open_cb2, \& $read_cb2, $close_cb2 ] ); \& $input_callbacks\->register_callbacks( [ $match_cb3, $open_cb3, \& $read_cb3, $close_cb3 ] ); \& \& $parser\->input_callbacks( $input_callbacks ); \& $parser\->parse_file( $some_xml_file ); .Ve .SS "What about the old callback system prior to XML::LibXML::InputCallback?" .IX Subsection "What about the old callback system prior to XML::LibXML::InputCallback?" In XML::LibXML versions prior to 1.59 \- i.e. without the XML::LibXML::InputCallback module \- you could define your callbacks either using globally or locally. You still can do that using XML::LibXML::InputCallback, and in addition to that you can define the callbacks on a per parser basis! .PP If you use the old callback interface through global callbacks, XML::LibXML::InputCallback will treat them with a lower priority as the ones registered using the new interface. The global callbacks will not override the callback groups registered using the new interface. Local callbacks are attached to a specific parser instance, therefore they are treated with highest priority. If the \fImatch\fR callback of the callback group registered as local variable is identical to one of the callback groups registered using the new interface, that callback group will be replaced. .PP Users of the old callback implementation whose \fIopen\fR callback returned a plain string, will have to adapt their code to return a reference to that string after upgrading to version >= 1.59. The new callback system can only deal with the \fIopen\fR callback returning a reference! .SH "INTERFACE DESCRIPTION" .IX Header "INTERFACE DESCRIPTION" .SS "Global Variables" .IX Subsection "Global Variables" .ie n .IP "$_CUR_CB" 4 .el .IP "\f(CW$_CUR_CB\fR" 4 .IX Item "$_CUR_CB" Stores the current callback and can be used as shortcut to access the callback stack. .ie n .IP "@_GLOBAL_CALLBACKS" 4 .el .IP "\f(CW@_GLOBAL_CALLBACKS\fR" 4 .IX Item "@_GLOBAL_CALLBACKS" Stores all callback groups for the current parser process. .ie n .IP "@_CB_STACK" 4 .el .IP "\f(CW@_CB_STACK\fR" 4 .IX Item "@_CB_STACK" Stores the currently used callback group. Used to prevent parser errors when dealing with nested \s-1XML\s0 data. .SS "Global Callbacks" .IX Subsection "Global Callbacks" .IP "_callback_match" 4 .IX Item "_callback_match" Implements the interface for the \fImatch\fR callback at C\-level and for the selection of the callback group from the callbacks defined at the Perl-level. .IP "_callback_open" 4 .IX Item "_callback_open" Forwards the \fIopen\fR callback from libxml2 to the corresponding callback function at the Perl-level. .IP "_callback_read" 4 .IX Item "_callback_read" Forwards the read request to the corresponding callback function at the Perl-level and returns the result to libxml2. .IP "_callback_close" 4 .IX Item "_callback_close" Forwards the \fIclose\fR callback from libxml2 to the corresponding callback function at the Perl-level.. .SS "Class methods" .IX Subsection "Class methods" .IP "\fInew()\fR" 4 .IX Item "new()" A simple constructor. .ie n .IP "register_callbacks( [ $match_cb, $open_cb, $read_cb, $close_cb ])" 4 .el .IP "register_callbacks( [ \f(CW$match_cb\fR, \f(CW$open_cb\fR, \f(CW$read_cb\fR, \f(CW$close_cb\fR ])" 4 .IX Item "register_callbacks( [ $match_cb, $open_cb, $read_cb, $close_cb ])" The four callbacks \fIhave\fR to be given as array reference in the above order \fImatch\fR, \fIopen\fR, \fIread\fR, \fIclose\fR! .ie n .IP "unregister_callbacks( [ $match_cb, $open_cb, $read_cb, $close_cb ])" 4 .el .IP "unregister_callbacks( [ \f(CW$match_cb\fR, \f(CW$open_cb\fR, \f(CW$read_cb\fR, \f(CW$close_cb\fR ])" 4 .IX Item "unregister_callbacks( [ $match_cb, $open_cb, $read_cb, $close_cb ])" With no arguments given, \f(CW\*(C`unregister_callbacks()\*(C'\fR will delete the last registered callback group from the stack. If four callbacks are passed as array reference, the callback group to unregister will be identified by the \fImatch\fR callback and deleted from the callback stack. Note that if several identical \fImatch\fR callbacks are defined in different callback groups, \s-1ALL\s0 of them will be deleted from the stack. .ie n .IP "init_callbacks( $parser )" 4 .el .IP "init_callbacks( \f(CW$parser\fR )" 4 .IX Item "init_callbacks( $parser )" Initializes the callback system for the provided parser before starting a parsing process. .IP "\fIcleanup_callbacks()\fR" 4 .IX Item "cleanup_callbacks()" Resets global variables and the libxml2 callback stack. .IP "\fIlib_init_callbacks()\fR" 4 .IX Item "lib_init_callbacks()" Used internally for callback registration at C\-level. .IP "\fIlib_cleanup_callbacks()\fR" 4 .IX Item "lib_cleanup_callbacks()" Used internally for callback resetting at the C\-level. .SH "EXAMPLE CALLBACKS" .IX Header "EXAMPLE CALLBACKS" The following example is a purely fictitious example that uses a MyScheme::Handler object that responds to methods similar to an IO::Handle. .PP .Vb 5 \& # Define the four callback functions \& sub match_uri { \& my $uri = shift; \& return $uri =~ /^myscheme:/; # trigger our callback group at a \*(Aqmyscheme\*(Aq URIs \& } \& \& sub open_uri { \& my $uri = shift; \& my $handler = MyScheme::Handler\->new($uri); \& return $handler; \& } \& \& # The returned $buffer will be parsed by the libxml2 parser \& sub read_uri { \& my $handler = shift; \& my $length = shift; \& my $buffer; \& read($handler, $buffer, $length); \& return $buffer; # $buffer will be an empty string \*(Aq\*(Aq if read() is done \& } \& \& # Close the handle associated with the resource. \& sub close_uri { \& my $handler = shift; \& close($handler); \& } \& \& # Register them with a instance of XML::LibXML::InputCallback \& my $input_callbacks = XML::LibXML::InputCallback\->new(); \& $input_callbacks\->register_callbacks([ \e&match_uri, \e&open_uri, \& \e&read_uri, \e&close_uri ] ); \& \& # Register the callback group at a parser instance \& $parser\->input_callbacks( $input_callbacks ); \& \& # $some_xml_file will be parsed using our callbacks \& $parser\->parse_file( $some_xml_file ); .Ve .SH "AUTHORS" .IX Header "AUTHORS" Matt Sergeant, Christian Glahn, Petr Pajas .SH "VERSION" .IX Header "VERSION" 2.0128 .SH "COPYRIGHT" .IX Header "COPYRIGHT" 2001\-2007, AxKit.com Ltd. .PP 2002\-2006, Christian Glahn. .PP 2006\-2009, Petr Pajas. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.