Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

dom domdocument getelementsbytagnamens function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php dom domdocument getelementsbytagnamens () function

Write your php code

 
<?php ?>

Php Result


Your code below



DOMDocument->getElementsByTagNameNS() --  Searches for all elements with given tag name in specified namespace

Syntax

class DOMDocument {

DOMNodeList getElementsByTagNameNS ( string namespaceURI, string localName )

}

Returns a DOMNodeList of all elements with a given local name and a namespace URI.

Parameters

namespaceURI

The namespace URI of the elements to match on. The special value * matches all namespaces.

localName

The local name of the elements to match on. The special value * matches all local names.

Return Values

A new DOMNodeList object containing all the matched elements.

Examples

Example 1. Get all the XInclude elements

<?php

$xml
= <<<EOD
<?xml version="1.0" ?>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Books of the other guy..</title>
<para>
<xi:include href="book.xml">
  <xi:fallback>
   <error>xinclude: book.xml not found</error>
  </xi:fallback>
</xi:include>
<include>
  This is another namespace
</include>
</para>
</chapter>
EOD;
$dom = new DOMDocument;

// load the XML string defined above
$dom->loadXML($xml);

foreach (
$dom->getElementsByTagNameNS('http://www.w3.org/2001/XInclude', '*') as $element) {
    echo
'local name: ', $element->localName, ', prefix: ', $element->prefix, "\n";
}
?>

The above example will output:

local name: include, prefix: xi
local name: fallback, prefix: xi

Php dom domdocument getelementsbytagnamens Function syntax tag

dom domdocument getelementsbytagnamens php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php dom domdocument getelementsbytagnamens syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online