26. Write a script to solve following questions (Use
“Book.xml” file)
a) Create a DOM
Document object and load this XML file.
b) Get the output of
this Document to the browser
c) Save this [. XML]
document in another format i.e. in [.doc]
d) Write a XML
program to print the names of the books available in “Book.xml” file.
XML file :
Same as
Q.24
Php file :
<?php
$doc=new
DOMDocument();
$doc->load("slip_18.xml");
$name=$doc->getElementsByTagName("book_name");
echo
"Books Names";
foreach($name
as $val)
{
echo "<br>".$val->textContent;
}
?>
No comments:
Post a Comment
Note: only a member of this blog may post a comment.