DOM_IMPORT_SIMPLEXML(3) 1 DOM_IMPORT_SIMPLEXML(3)dom_import_simplexml - Gets aDOMElementobject from aSimpleXMLElementobjectSYNOPSIS
DOMElement dom_import_simplexml (SimpleXMLElement $node)
DESCRIPTION
This function takes the node $node of class SimpleXML and makes it into a DOMElement node. This new object can then be used as a native
DOMElement node.
PARAMETERS
o $node
- The SimpleXMLElement node.
RETURN VALUES
The DOMElement node added or FALSE if any errors occur.
EXAMPLES
Example #1
Import SimpleXML into DOM with dom_import_simplexml(3)
<?php
$sxe = simplexml_load_string('<books><book><title>blah</title></book></books>');
if ($sxe === false) {
echo 'Error while parsing the document';
exit;
}
$dom_sxe = dom_import_simplexml($sxe);
if (!$dom_sxe) {
echo 'Error while converting XML';
exit;
}
$dom = new DOMDocument('1.0');
$dom_sxe = $dom->importNode($dom_sxe, true);
$dom_sxe = $dom->appendChild($dom_sxe);
echo $dom->saveXML();
?>
SEE ALSO simplexml_import_dom(3).
PHP Documentation Group DOM_IMPORT_SIMPLEXML(3)
Check Out this Related Man Page
DOMDOCUMENT.CREATEELEMENT(3) 1 DOMDOCUMENT.CREATEELEMENT(3)DOMDocument::createElement - Create new element node
SYNOPSIS
public DOMElement DOMDocument::createElement (string $name, [string $value])
DESCRIPTION
This function creates a new instance of class DOMElement. This node will not show up in the document unless it is inserted with (e.g.)
DOMNode.appendChild(3).
PARAMETERS
o $name
- The tag name of the element.
o $value
- The value of the element. By default, an empty element will be created. The value can also be set later with DOMElement::$node-
Value.
RETURN VALUES
Returns a new instance of class DOMElement or FALSE if an error occurred.
ERRORS /EXCEPTIONS
o DOM_INVALID_CHARACTER_ERR - Raised if $name contains an invalid character.
EXAMPLES
Example #1
Creating a new element and inserting it as root
<?php
$dom = new DOMDocument('1.0', 'utf-8');
$element = $dom->createElement('test', 'This is the root element!');
// We insert the new element as root (child of the document)
$dom->appendChild($element);
echo $dom->saveXML();
?>
The above example will output:
<?xml version="1.0" encoding="utf-8"?>
<test>This is the root element!</test>
NOTES
Note
The $value will not be escaped. Use DOMDocument::createTextNode to create a text node with escaping support.
SEE ALSO
DOMNode::appendChild, DOMDocument::createAttribute, DOMDocument::createAttributeNS, DOMDocument::createCDATASection, DOMDocument::create-
Comment, DOMDocument::createDocumentFragment, DOMDocument::createElementNS, DOMDocument::createEntityReference, DOMDocument::createPro-
cessingInstruction, DOMDocument::createTextNode.
PHP Documentation Group DOMDOCUMENT.CREATEELEMENT(3)
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)
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)
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)
:) :)
*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)
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)
now, i have been reading alot of books about this load balancing thing. when looking at the output of iostat and one determines that the disks do not have roughly equivalent utilization rate, books i've read mentions balancing the loads so the loads are spread evenly across the disks.
Now, i... (6 Replies)
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)
Hi
i have to work with pro c,c++ , can any body help me or that which are the best books for that,and some web address where i can get suitable information,
:( (4 Replies)
I have another question. I have access to the books listed below, however I know that not all of them are the lates and greatest and some are over 10 years old. So the question is are most of these books still a good idea to read. Or should I try and pick up the latest and greatest editions?
... (5 Replies)
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)
I bought a Sony PRS-650 Reader to read books and I'm loving it.
For one thing, there are zillions of free books in epub format available for download for free. Many of them are out of print, so you would have to pay a high price to get a printed copy. Most current releases have to be paid for,... (15 Replies)
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)
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)
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)