📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  class / eZDOMDocument  

eZDOMDocument Class Reference
[XML parser and DOM library]

eZDOMDocument handles DOM nodes in DOM documents More...

List of all members.


Public Methods

 eZDOMDocument ($name="")
 setName ($name)
& root ()
 setRoot (&$node)
 appendChild (&$node)
& createTextNode ($text)
& createCDATANode ($text)
& createElementNode ($name,$attributes=array())
& createElementTextNode ($name,$text,$attributes=array())
& createElementCDATANode ($name,$text,$attributes=array())
& createElementNodeNS ($uri,$name)
& createAttributeNode ($name,$content,$prefix=false)
& createAttributeNamespaceDefNode ($prefix,$uri)
& createAttributeNodeNS ($uri,$name,$content)
& toString ($charset=true,$charsetConversion=true)
 registerElement (&$node)
& elementsByName ($name)
& elementsByNameNS ($name,$namespaceURI)
 registerNamespaceAlias ($alias,$namespace)
& namespaceByAlias ($alias)

Public Attributes

 Name
 Document name.

 Version
 XML version.

 NamedNodes = array()
 Contains an array of reference to the named nodes with namespace.

 NamedNodesNS = array()
 Contains an array of references to the named nodes with namespace.

 Namespaces = array()
 Contains an array of the registered namespaces and their aliases.

 Root
 Reference to the first child of the DOM document.


Detailed Description

eZDOMDocument handles DOM nodes in DOM documents

  $doc = new eZDOMDocument();
  $doc->setName( "FishCatalogue" );

  $root =& $doc->createElementNode( "FishCatalogue" );
  $doc->setRoot( $root );

  $freshWater =& $doc->createElementNode( "FreshWater" );
  $root->appendChild( $freshWater );

  $saltWater =& $doc->createElementNode( "SaltWater" );
  $root->appendChild( $saltWater );

  $guppy =& $doc->createElementNode( "Guppy" );
  $guppy->appendChild( $doc->createTextNode( "Guppy is a small livebreeder." ) );

  $freshWater->appendChild( $guppy );

  $cod =& $doc->createElementNode( "Cod" );
  $saltWater->appendChild( $cod );

  $cod->appendChild( $doc->createCDATANode( "A big dull fish <-> !!" ) );

  print( $doc->toString() );

  // will print the following
    <?xml version="1.0"?>
    <FishCatalogue>
      <FreshWater>
        <Guppy>
    Guppy is a small livebreeder.    </Guppy>
      </FreshWater>
      <SaltWater>
        <Cod>
    <![CDATA[A big dull fish <-> !!]]>    </Cod>
      </SaltWater>
    </FishCatalogue>

Definition at line ezdomdocument.php.


Constructor & Destructor Documentation

eZDOMDocument::eZDOMDocument (  $    name = "" ) 
 

Creates a new DOM document object. You can provide a name for the document.

Definition at line ezdomdocument.php.

References Name.


Member Function Documentation

eZDOMDocument::appendChild (  &$    node ) 
 

Sets the document root.

Definition at line ezdomdocument.php.

References Root.

& eZDOMDocument::createAttributeNamespaceDefNode (  $    prefix,
$    uri
) 
 

Creates an namespace definition attribute

Definition at line ezdomdocument.php.

Referenced by eZContentObject::serialize().

& eZDOMDocument::createAttributeNode (  $    name,
$    content,
$    prefix = false
) 
 

Creates and returns an attribute node

Definition at line ezdomdocument.php.

Referenced by eZDataType::serializeContentObjectAttribute().

& eZDOMDocument::createAttributeNodeNS (  $    uri,
$    name,
$    content
) 
 

Creates and returns an attribute node with a namespace URI

Definition at line ezdomdocument.php.

& eZDOMDocument::createCDATANode (  $    text ) 
 

Creates and returns a cdata node.

Definition at line ezdomdocument.php.

Referenced by createElementCDATANode().

& eZDOMDocument::createElementCDATANode (  $    name,
$    text,
$    attributes = array()
) 
 

Creates and returns a element node with a CDATA node as child.

See also:
createElementNode

Definition at line ezdomdocument.php.

References createElementNode().

& eZDOMDocument::createElementNode (  $    name,
$    attributes = array()
) 
 

Creates and returns a element node

Definition at line ezdomdocument.php.

Referenced by eZSOAPRequest::encodeValue().

& eZDOMDocument::createElementNodeNS (  $    uri,
$    name
) 
 

Creates and returns a element node with a namespace URI

Definition at line ezdomdocument.php.

& eZDOMDocument::createElementTextNode (  $    name,
$    text,
$    attributes = array()
) 
 

Creates and returns a element node with a text node as child.

See also:
createElementNode

Definition at line ezdomdocument.php.

References createTextNode().

& eZDOMDocument::createTextNode (  $    text ) 
 

Creates and returns a text node.

Definition at line ezdomdocument.php.

Referenced by eZStringType::serializeContentObjectAttribute().

& eZDOMDocument::elementsByName (  $    name ) 
 

Returns all the elements with the given name by reference.

Definition at line ezdomdocument.php.

References NamedNodes.

& eZDOMDocument::elementsByNameNS (  $    name,
$    namespaceURI
) 
 

Returns all the elements with the given name and namespace URI by reference.

Definition at line ezdomdocument.php.

References NamedNodesNS.

& eZDOMDocument::namespaceByAlias (  $    alias ) 
 

Returns the namespace which corresponds to the given alias. Returns false if the namespace is not known.

Definition at line ezdomdocument.php.

References Namespaces.

eZDOMDocument::registerElement (  &$    node ) 
 

Registers the elements

Definition at line ezdomdocument.php.

References NamedNodesNS.

eZDOMDocument::registerNamespaceAlias (  $    alias,
$    namespace
) 
 

Regsiter a new namespace alias. Provide the alias/prefix and the namespace identifier.

Definition at line ezdomdocument.php.

References Namespaces.

& eZDOMDocument::root (    ) 
 

Returns the document root if it exists. False is returned if the root does not exist.

Definition at line ezdomdocument.php.

References Root.

eZDOMDocument::setName (  $    name ) 
 

Sets the document name

Definition at line ezdomdocument.php.

References Name.

eZDOMDocument::setRoot (  &$    node ) 
 

Sets the document root.

Definition at line ezdomdocument.php.

References Root.

& eZDOMDocument::toString (  $    charset = true,
$    charsetConversion = true
) 
 

Returns a XML string of the DOM document

Definition at line ezdomdocument.php.

References Root.


The documentation for this class was generated from the following file:  

Exponential Copyright © 1998 - 2026 7x