.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" 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 >0, 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "XML::Compile::Util 3pm" .TH XML::Compile::Util 3pm "2016-10-31" "perl v5.24.1" "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::Compile::Util \- Utility routines for XML::Compile components .SH "INHERITANCE" .IX Header "INHERITANCE" .Vb 2 \& XML::Compile::Util \& is a Exporter .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use XML::Compile::Util; \& my $node_type = pack_type $ns, $localname; \& my ($ns, $localname) = unpack_type $node_type; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The functions provided by this package are used by various XML::Compile components, which on their own may be unrelated. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "Constants" .IX Subsection "Constants" The following URIs are exported as constants, to avoid typing in the same long URIs each time again: \s-1XMLNS, SCHEMA1999, SCHEMA2000, SCHEMA2001,\s0 and SCHEMA2001i. .SS "Packing" .IX Subsection "Packing" .ie n .IP "\fBpack_id\fR($ns, $id)" 4 .el .IP "\fBpack_id\fR($ns, \f(CW$id\fR)" 4 .IX Item "pack_id($ns, $id)" Translates the two arguments into one compact string representation of the node id. .Sp example: .Sp .Vb 2 \& print pack_id \*(Aqhttp://my\-ns\*(Aq, \*(Aqmy\-id\*(Aq; \& # shows: http://my\-ns#my\-id .Ve .ie n .IP "\fBpack_type\fR( [$ns], $localname )" 4 .el .IP "\fBpack_type\fR( [$ns], \f(CW$localname\fR )" 4 .IX Item "pack_type( [$ns], $localname )" Translates the arguments into one compact string representation of the node type. When the \f(CW$ns\fR is not present, \f(CW\*(C`undef\*(C'\fR, or an empty string, then no namespace is presumed, and no curly braces part made. .Sp example: .Sp .Vb 2 \& print pack_type \*(Aqhttp://my\-ns\*(Aq, \*(Aqmy\-type\*(Aq; \& # shows: {http://my\-ns}my\-type \& \& print pack_type \*(Aqmy\-type\*(Aq; \& print pack_type undef, \*(Aqmy\-type\*(Aq; \& print pack_type \*(Aq\*(Aq, \*(Aqmy\-type\*(Aq; \& # all three show: my\-type .Ve .IP "\fBunpack_id\fR($string)" 4 .IX Item "unpack_id($string)" Returns a \s-1LIST\s0 of two elements: the name-space and the id, as included in the \f(CW$string\fR. That \f(CW$string\fR must be compatible with the result of \fIpack_id()\fR. .IP "\fBunpack_type\fR($string)" 4 .IX Item "unpack_type($string)" Returns a \s-1LIST\s0 of two elements: the name-space and the localname, as included in the \f(CW$string\fR. That \f(CW$string\fR must be compatible with the result of \fIpack_type()\fR. When no name-space is present, an empty string is used. .SS "Other" .IX Subsection "Other" .ie n .IP "\fBadd_duration\fR( $duration, [$time] )" 4 .el .IP "\fBadd_duration\fR( \f(CW$duration\fR, [$time] )" 4 .IX Item "add_duration( $duration, [$time] )" [1.44] Add the \f(CW$duration\fR to the \f(CW$time\fR (defaults to 'now') This is an expensive operation: in many cases the \fIduration2secs()\fR produces useful results as well. .Sp example: .Sp .Vb 2 \& my $now = time; \& my $deadline = add_duration \*(AqP1M\*(Aq, $now; # deadline in 1 month .Ve .IP "\fBduration2secs\fR($duration)" 4 .IX Item "duration2secs($duration)" [1.44] Translate any format into seconds. This is an example of a valid duration: \f(CW\*(C`\-PT1M30.5S\*(C'\fR Average month and year lengths are used. If you need more precise calculations, then use \fIadd_duration()\fR. .IP "\fBeven_elements\fR(\s-1LIST\s0)" 4 .IX Item "even_elements(LIST)" Returns the even-numbered elements from the \s-1LIST.\s0 .IP "\fBodd_elements\fR(\s-1LIST\s0)" 4 .IX Item "odd_elements(LIST)" Returns the odd-numbered elements from the \s-1LIST.\s0 .IP "\fBtype_of_node\fR($node)" 4 .IX Item "type_of_node($node)" Translate an XML::LibXML::Node into a packed type. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of XML-Compile distribution version 1.54, built on September 19, 2016. Website: \fIhttp://perl.overmeer.net/xml\-compile/\fR .PP Please post questions or ideas to the mailinglist at \&\fIhttp://lists.scsys.co.uk/cgi\-bin/mailman/listinfo/xml\-compile\fR . For live contact with other developers, visit the \f(CW\*(C`#xml\-compile\*(C'\fR channel on \f(CW\*(C`irc.perl.org\*(C'\fR. .SH "LICENSE" .IX Header "LICENSE" Copyrights 2006\-2016 by [Mark Overmeer]. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR