GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XML::COMPILE::UTIL (3)

.ds Aq ’

NAME

XML::Compile::Util - Utility routines for XML::Compile components

CONTENTS

INHERITANCE



 XML::Compile::Util
   is a Exporter



SYNOPSIS



 use XML::Compile::Util;
 my $node_type = pack_type $ns, $localname;
 my ($ns, $localname) = unpack_type $node_type;



DESCRIPTION

The functions provided by this package are used by various XML::Compile components, which on their own may be unrelated.

FUNCTIONS

    Constants

The following URIs are exported as constants, to avoid typing in the same long URIs each time again: XMLNS, SCHEMA1999, SCHEMA2000, SCHEMA2001, and SCHEMA2001i.

    Packing

<B>pack_idB>($ns, $id) Translates the two arguments into one compact string representation of the node id.

example:



 print pack_id http://my-ns, my-id;
 # shows:  http://my-ns#my-id



<B>pack_typeB>( [$ns], $localname ) Translates the arguments into one compact string representation of the node type. When the $ns is not present, undef, or an empty string, then no namespace is presumed, and no curly braces part made.

example:



 print pack_type http://my-ns, my-type;
 # shows:  {http://my-ns}my-type

 print pack_type my-type;
 print pack_type undef, my-type;
 print pack_type , my-type;
 # all three show:   my-type



<B>unpack_idB>($string) Returns a LIST of two elements: the name-space and the id, as included in the $string. That $string must be compatible with the result of pack_id().
<B>unpack_typeB>($string) Returns a LIST of two elements: the name-space and the localname, as included in the $string. That $string must be compatible with the result of pack_type(). When no name-space is present, an empty string is used.

    Other

<B>add_durationB>( $duration, [$time] ) [1.44] Add the $duration to the $time (defaults to ’now’) This is an expensive operation: in many cases the duration2secs() produces useful results as well.

example:



   my $now      = time;
   my $deadline = add_duration P1M, $now;  # deadline in 1 month



<B>duration2secsB>($duration) [1.44] Translate any format into seconds. This is an example of a valid duration: -PT1M30.5S Average month and year lengths are used. If you need more precise calculations, then use add_duration().
<B>even_elementsB>(LIST) Returns the even-numbered elements from the LIST.
<B>odd_elementsB>(LIST) Returns the odd-numbered elements from the LIST.
<B>type_of_nodeB>($node) Translate an XML::LibXML::Node into a packed type.

SEE ALSO

This module is part of XML-Compile distribution version 1.52, built on January 15, 2016. Website: http://perl.overmeer.net/xml-compile/

Other distributions in this suite: XML::Compile, XML::Compile::SOAP, XML::Compile::WSDL11, XML::Compile::SOAP12, XML::Compile::SOAP::Daemon, XML::Compile::SOAP::WSA, XML::Compile::C14N, XML::Compile::WSS, XML::Compile::WSS::Signature, XML::Compile::Tester, XML::Compile::Cache, XML::Compile::Dumper, XML::Compile::RPC, XML::Rewrite and XML::LibXML::Simple.

Please post questions or ideas to the mailinglist at http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile . For live contact with other developers, visit the #xml-compile channel on irc.perl.org.

LICENSE

Copyrights 2006-2016 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 XML::COMPILE::UTIL (3) 2016-01-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.