XML-GDOME

 view release on metacpan or  search on metacpan

lib/XML/GDOME/Document.pod  view on Meta::CPAN

=head1 NAME

  XML::GDOME::Document - Interface Document implementation.

=head1 SYNOPSIS

  $docType  = $doc->getDoctype();
  $elem     = $doc->getDocumentElement();
  $DOMImpl  = $doc->getImplementation();
  $attr     = $doc->createAttribute($name);
  $attr     = $doc->createAttributeNS($namespaceURI,$qualifiedName);
  $cdata    = $doc->createCDATASection($data);
  $comment  = $doc->createComment($data);
  $docFrag  = $doc->createDocumentFragment();
  $elem     = $doc->createElement($tagName);
  $elem     = $doc->createElementNS($namespaceURI,$qualifiedName);
  $entRef   = $doc->createEntityReference($name);
  $pi       = $doc->createProcessingInstruction($target,$data);
  $text     = $doc->createTextNode($data);
  $elem     = $doc->getElementById($elementId);
  $nodeList = $doc->getElementsByTagName($tagname);
  $nodeList = $doc->getElementsByTagNameNS($namespaceURI,$localName);
  $node     = $doc->importNode($importedNode,$deep);
  $str      = $doc->toString($mode);
  $str      = $doc->toStringEnc($encoding,$mode);

=head1 CLASS INHERITANCE

L<XML::GDOME::Node> > XML::GDOME::Document


=head1 METHODS

=over 4


=item $docType = $doc->getDoctype();



I<Returns>: The Document Type Declaration associated with this document. The DOM Level 2 does not support editing the Document Type Declaration. docType cannot be altered in any way, including through the use of methods inherited from the Node interf...


=item $elem = $doc->getDocumentElement();



I<Returns>: the root Element of the Document.


=item $DOMImpl = $doc->getImplementation();



I<Returns>: the DOMImplementation object that handles this document.


=item $attr = $doc->createAttribute($name);

Creates an Attr of the given I<name>. Note that the Attr instance can then be set on an Element using the setAttributeNode method. To create an attribute with a qualified name and namespace URI, use the gdome_doc_createAttributeNS() method.

I<C<name>>: The name of the attribute

I<Returns>: a new Attr object with the nodeName attribute set to I<name>, and localName, prefix, and namespaceURI set to undef. The value of the attribute is the empty string.


=item $attr = $doc->createAttributeNS($namespaceURI,$qualifiedName);

Creates an attribute of the given qualified name and namespace URI.

I<C<namespaceURI>>: The namespace URI of the attribute to create

I<C<qualifiedName>>: The qualified name of the attribute to create

I<Returns>: a new Attr object with the following attributes: %Node.nodeName = I<qualifiedName>, %Node.namespaceURI = I<namespaceURI>, %Node.prefix = prefix, extracted from I<qualifiedName>, %Node.localName = localName, extracted from I<qualifiedName>...

C<GDOME_NAMESPACE_ERR>: Raised if the I<qualifiedName> is malformed, if the I<qualifiedName> has a prefix and the I<namespaceURI> is %NUKK, if the I<qualifiedName> has a prefix that is "xml" and the I<namespaceURI> is different from "http://www.w3.or...


=item $cdata = $doc->createCDATASection($data);

Creates a CDATASection node whose value is the specified string.

I<C<data>>: The data for the CDATASection contents

I<Returns>: the new CDATASection object.


=item $comment = $doc->createComment($data);

Creates a Comment node whose value is the specified string.

I<C<data>>: The data for the comment contents

I<Returns>: the new Comment object.


=item $docFrag = $doc->createDocumentFragment();

Creates an empty DocumentFragment object. 

I<Returns>: the new DocumentFragment object.


=item $elem = $doc->createElement($tagName);

Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object. To create an element with a qualified name and namespace URI, use the gdome_do...

I<C<tagName>>: The name of the element type to instantiate.

I<Returns>: a new Element object with the nodeName attribute set to tagName, and localName, prefix, and namespaceURI set to undef.


=item $elem = $doc->createElementNS($namespaceURI,$qualifiedName);

Creates an element of the given qualified name and namespace URI.

I<C<namespaceURI>>: The namespace URI of the element to create

I<C<qualifiedName>>: The qualified name of the element to create

I<Returns>: a new Element object with the following attributes: %Node.nodeName = I<qualifiedName>, %Node.namespaceURI = I<namespaceURI>, %Node.prefix = prefix, extracted from I<qualifiedName>, %Node.localName = localName, extracted from I<qualifiedNa...

C<GDOME_NAMESPACE_ERR>: Raised if the I<qualifiedName> is malformed, if the I<qualifiedName> has a prefix and the I<namespaceURI> is undef, or if the I<qualifiedName> has a prefix that is "xml" and the I<namespaceURI> is different from "http://www.w3...


=item $entRef = $doc->createEntityReference($name);

Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.

I<C<name>>: The name of the entity to reference

I<Returns>: the new EntityReference object.


=item $pi = $doc->createProcessingInstruction($target,$data);

Creates a ProcessingInstruction node given the specified name and data strings.

I<C<target>>: The target part of the processing instruction



( run in 1.007 second using v1.01-cache-2.11-cpan-39bf76dae61 )