Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

simplexml_import_dom(3) [php man page]

SIMPLEXML_IMPORT_DOM(3) 						 1						   SIMPLEXML_IMPORT_DOM(3)

simplexml_import_dom - Get a SimpleXMLElementobject from a DOM node.

SYNOPSIS
SimpleXMLElement simplexml_import_dom (DOMNode $node, [string $class_name = "SimpleXMLElement"]) DESCRIPTION
This function takes a node of a DOM document and makes it into a SimpleXML node. This new object can then be used as a native SimpleXML element. PARAMETERS
o $node - A DOM Element node o $class_name - You may use this optional parameter so that simplexml_import_dom(3) will return an object of the specified class. That class should extend the SimpleXMLElement class. RETURN VALUES
Returns a SimpleXMLElement or FALSE on failure. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. EXAMPLES
Example #1 Importing DOM <?php $dom = new DOMDocument; $dom->loadXML('<books><book><title>blah</title></book></books>'); if (!$dom) { echo 'Error while parsing the document'; exit; } $s = simplexml_import_dom($dom); echo $s->book[0]->title; ?> The above example will output: blah SEE ALSO
dom_import_simplexml(3), "Basic SimpleXML usage". PHP Documentation Group SIMPLEXML_IMPORT_DOM(3)

Check Out this Related Man Page

SIMPLEXMLITERATOR(3)							 1						      SIMPLEXMLITERATOR(3)

The SimpleXMLIterator class

INTRODUCTION
The SimpleXMLIterator provides recursive iteration over all nodes of a SimpleXMLElement object. CLASS SYNOPSIS
SimpleXMLIterator SimpleXMLIteratorextends SimpleXMLElementRecursiveIteratorCountable Methods o public mixed SimpleXMLIterator::current (void ) o public SimpleXMLIterator SimpleXMLIterator::getChildren (void ) o public bool SimpleXMLIterator::hasChildren (void ) o public mixed SimpleXMLIterator::key (void ) o public void SimpleXMLIterator::next (void ) o public void SimpleXMLIterator::rewind (void ) o public bool SimpleXMLIterator::valid (void ) Inherited methods o finalpublic SimpleXMLElement::__construct (string $data, [int $options], [bool $data_is_url = false], [string $ns = ""], [bool $is_prefix = false]) o public void SimpleXMLElement::addAttribute (string $name, [string $value], [string $namespace]) o public SimpleXMLElement SimpleXMLElement::addChild (string $name, [string $value], [string $namespace]) o public mixed SimpleXMLElement::asXML ([string $filename]) o public SimpleXMLElement SimpleXMLElement::attributes NULL ([string $ns], [bool $is_prefix = false]) o public SimpleXMLElement SimpleXMLElement::children ([string $ns], [bool $is_prefix = false]) o public int SimpleXMLElement::count (void ) o public array SimpleXMLElement::getDocNamespaces ([bool $recursive = false], [bool $from_root = true]) o public string SimpleXMLElement::getName (void ) o public array SimpleXMLElement::getNamespaces ([bool $recursive = false]) o public bool SimpleXMLElement::registerXPathNamespace (string $prefix, string $ns) o public string SimpleXMLElement::__toString (void ) o public array SimpleXMLElement::xpath (string $path) PHP Documentation Group SIMPLEXMLITERATOR(3)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

IRIX books, manuals, references...

Does anyone out there know of ANY specific books pertaining to SGI's flavor of Unix - IRIX? I have been in contact with SGI directly and they have not supplied me with any usable reference material or manuals. I realize man pages are a good source for info, but I need to go a little deeper... (6 Replies)
Discussion started by: lozinit
6 Replies

2. New to Unix. Which books should I read?

Unix Books

I'm just looking for really good unix book on programming in all shells, and system adminstrator books, and well as just all around really good books on unix. I know the "Unix Shell Programming" book that Neo recommends I recently purchased that it is very good. But when I heard that Neo has... (13 Replies)
Discussion started by: Astudent
13 Replies

3. UNIX for Dummies Questions & Answers

Unix Books

I'm just looking for really good unix book on programming in all shells, and system adminstrator books, and well as just all around really good books on unix. I know the "Unix Shell Programming" book that Neo recommends I recently purchased that it is very good. But when I heard that Neo has... (13 Replies)
Discussion started by: Astudent
13 Replies

4. UNIX for Dummies Questions & Answers

new user

:) :) *can any one help me to now how to learn lunix ? *or any site to teach me *or any book to teach me *and it will be great if u told me from where *i can bring the soft ware THANK U (4 Replies)
Discussion started by: engsonson
4 Replies

5. UNIX for Dummies Questions & Answers

Books needed.

New here. I work for a company that has UNIX on it's server and would like to know where I could get a detailed book on the OS or what it is called. If I can increase my knowledge I may be able to land the Systems Administrator's job. No one is currently in this possition. I live in Canada, so... (6 Replies)
Discussion started by: The Byrd
6 Replies

6. Shell Programming and Scripting

little help needed with my awk

i got a file (books.txt) 12 A 15 B And i want to output: Group allocation Group A: 12 books Group B: 15 books .. End List i know how to reverse the two fields by using awk {print $2,$1} books.txt Im having problems outputting what i wanted using awk so far i got: {print... (5 Replies)
Discussion started by: thewizard
5 Replies

7. Shell Programming and Scripting

Online/downloadable Shell Scripting book

Greetings All!! I am looking out for a comprehensive shell scripting book (unix & linux). I would request you to kindly post the links to get donwloadable/online books. I would prefer for the "Linux and Unix shell programming" by David Tansley. Any help will be highly appreciable. Cheers ... (5 Replies)
Discussion started by: arminder
5 Replies

8. UNIX for Dummies Questions & Answers

Putting echoed text into a new file

Hi, I've set up a script so that a user answers questions, and then these answers come back onto the screen accompanied by text that I've echoed. Is there a way of putting this into a new file? Thanks (7 Replies)
Discussion started by: likelylad
7 Replies

9. Shell Programming and Scripting

Parse string

Hi, I need to parse a string, check if there are periods and strip the string. For example i have the following domains and subdomains: mydomain.com, dev.mydomain.com I need to strip all periods so i have a string without periods or domain extensions: mydomain, devmydomain. I use this for... (12 Replies)
Discussion started by: ktm
12 Replies

10. UNIX for Dummies Questions & Answers

What is meant by subprocesses?

I'm going through my UNIX book and came across a section on Customization and Subprocesses. Can someone tell me what a subprocess is -- for example, when the book says "Which shell 'thing' are known to subprocesses" what exactly does it mean? The book just talks about it without defining it... (10 Replies)
Discussion started by: Straitsfan
10 Replies

11. Programming

Books for advanced C

Simple question , what good book is next step in learning C. I finished with K&R and I want to go to the next step , so if someone has a good book please share title :D I looked for Advanced C programming by example but it is too expansive 400$ on Amazon :( So please tell me (7 Replies)
Discussion started by: solaris_user
7 Replies

12. Shell Programming and Scripting

query in using Double Quotes

Hi i am referring a book for understanding the Double Quotes book suggest for the below code code echo "$USER owes <-$1250.**>; " the o/p isFred owes <-250.**>; however when i ran the same command i got below o/piscpadm owes <-250.**>; need to know why i am not getting the... (8 Replies)
Discussion started by: scriptor
8 Replies

13. What is on Your Mind?

How do you prefer to read books?

Time for a new poll. Just wondering how members in this forum prefer to read books. Paper E-reader Tablet Laptop/Desktop Smartphone Audiobook Not much of a reader Other A poll is added. If you select option: Other, please specify what it is. :b: (14 Replies)
Discussion started by: Yoda
14 Replies

14. Homework & Coursework Questions

Help on Reading UNIX Programming Books.

I've purchased few unix/linux programming books and also planning to buy couple of books in future. I've got the following books; Advanced Unix Programming(2nd ed) -- M. Rochkind. Advanced Programming on Unix Environment(3rd ed) -- Late Rick Stevens & Rago. Unix Systems Programming -... (8 Replies)
Discussion started by: vectrum
8 Replies