PrepAway - Latest Free Exam Questions & Answers

What should be displayed when this script is executed?

You have given the following XML data in the tasks.XML file:
<code>
<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<tasklist>
<note>
<tasks>Validate data</tasks>
<details>String Validation</details>
</note>
<note>
<tasks>Secure data</tasks>
<details>Encryption</details>
</note>
</tasklist>
</code>
Now, you run the following PHP script:
<code>
<?php
$objDOM = new DOMDocument();
$objDOM->load(“tasks.xml”);
$note = $objDOM->getElementsByTagName(“note”);
foreach( $note as $value )
{
$tasks = $value->getElementsByTagName(“tasks”);
$task = $tasks->item(0)->nodeValue;
$details = $value->getElementsByTagName(“details”);
$detail = $details->item(0)->nodeValue;
echo “$task :: $detail <br>”;
}
?>
</code>
What should be displayed when this script is executed?

PrepAway - Latest Free Exam Questions & Answers

A.
The contents of the whole XML document

B.
The XML of every tasks and details nodes

C.
The contents of every tasks and details nodes

D.
The XML of whole XML document


Leave a Reply

Your email address will not be published. Required fields are marked *