BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
PHP XML
PHP DOMElement Function removeAttributeNS
PHP DOMElement Function removeAttributeNode
PHP DOMElement Function removeAttribute
PHP DOMElement Function hasAttributeNS
PHP DOMElement Function getAttribute
PHP DOMDocument Function getElementsByTagNameNS
PHP DOMDocument Function xinclude
PHP DOMDocument Function validate
PHP DOMDocument Function setAttributeNS
PHP DOMDocument Function setAttribute
PHP DOMDocument Function schemaValidateSource (handling errors)
PHP DOMDocument Function schemaValidateSource
PHP DOMDocument Function schemaValidate
PHP DOMDocument Function saveXML
PHP DOMDocument Function saveHTMLFile
PHP DOMDocument Function saveHTML
PHP DOMDocument Function normalize
PHP DOMDocument Function loadXML
PHP DOMDocument Function loadHTMLFile
PHP DOMDocument Function loadHTML
 
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :243

 

DOMImplementation Function createDocument

PHP Version: (No version information might be only in CVS. I have used this function in PHP5)

DOM: W3C DOM Level 1

Description

This function creates an instance of the DomDocument object.

Usage:

objectDOMImplementation->createDocument ( [string namespaceURI [, string qualifiedName [, object doctype]]])

Creates a DOMDocument object of the specified type with its document element. If namespaceURI, qualifiedName, and doctype are null, the returned DOMDocument is empty with no document element

Throws DOMException if there is an error with the namespace, as determined by namespaceURI and qualifiedName, or if doctype is not valid.

PHP Code:

<?php

// Create an instance of the DomImplementation class

$impl = new DomImplementation;

// Create an instance of the DomDocumentType class by

// calling the DomImplementation::createDocumentType() method

// (arguments: doctype_name, doctype_public, doctype_system)

$dtd = $impl->createDocumentType("employee", "", "employee.dtd");

// Create an instance of the DomDocument class by

// calling the DomImplementation::createDocument() method

// (arguments: NS_URL, NS_PREFIX, DomDocumentType_instance)

$dom = $impl->createDocument("", "",$dtd);

// Set other properties

$dom->encoding = "UTF-8";

$dom->standalone = "no";

// Create an empty element

$root = $dom->createElement("employee");

// Append the element

$dom->appendChild($root);

//echo out the XML tree using saveXML() and echo function.

echo "<HTML>";

echo "<Head>";

echo "<title>Example of createDocument</title>";

echo "<Head>";

echo "<body>";

echo "<PRE>";

echohtmlentities($dom->saveXML());

echo "</PRE>";

echo "</body>";

echo "</HTML>";

?>

Output:

New attribute with name street created in employeeaddress element.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
unlimited conferencing
swimming pool contractor
large conference calls
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP