NAME
XML::LibXML::Common - Routines and Constants common for XML::LibXML and
XML::GDOMESYNOPSIS
use XML::LibXML::Common;
DESCRIPTION
XML::LibXML and XML::GDOME share some of the same functionality. This package should bundle some shared constansts and functions, so both modules may coexist within the same scripts.XML::LibXML::Common defines all node types as constants. While
XML::LibXML and XML::GDOME originally declared their own node typedefinitions, one may want to use XML::LibXML::Common in its
compatibility mode:+o use XML::LibXML::Common qw(:libxml);
:libxml will use the XML::LibXML Compatibility mode, which definesthe old 'XML' node-type definitions
+o use XML::LibXML::Common qw(:gdome);
This allows one to use the XML::LibXML Compatibility mode, whichdefines the old 'GDOME' node-type definitions
+o use XML::LibXML::Common qw(:w3c);
This uses the nodetype definition names as specified for DOM.+o use XML::LibXML::Common qw(:encoding);
This is ment if only the encoding functions of XML::LibXML::Common
should be used. By default the W3 definitions as defined in the DOM specifications andthe encoding functions are exported by XML::LibXML::Common.
eennccooddiinngg ffuunnccttiioonnssTo encode or decode a string to or from UTF-8 XML::LibXML::Common
exports two functions, which use the encoding mechanism of the underlaying implementation. These functions should be used, if external encoding is required (e.g. for queryfunctions). eennccooddeeTTooUUTTFF88$encodedstring = encodeToUTF8( $nameofencoding, $stingtoencode );
The function will encode a string from the specified encoding to UTF-8.
ddeeccooddeeFFrroommUUTTFF88$decodedstring = decodeFromUTF8($nameofencoding, $stringtodecode );
This Function transforms an UTF-8 encoded string the specified
encoding. While transforms to ISO encodings may cause errors if the given stirng contains unsupported characters, both functions cantransform to UTF-16 encodings as well.
Note that both encoding functions report their errors on the standard error. If an error occours the function will croak(). To catch the error information it is required to call the encoding function from within an eval block to avoid a script to stop. AUTHOR Christian Glahn, (christian.glahn@uibk.ac.at) Innsbruck University COPYRIGHT (c) 2002 Christian Glahn. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.SEE ALSO
perl, XML::LibXML, XML::GDOMEperl v5.8.8 2003-02-27 Common(3)