<?php
/* Include the phpDOM - library */
define( "PHPDOM_INCLUDE_DIR", ">>your path here<<" );
include( PHPDOM_INCLUDE_DIR . "domxml_document.php" );
/* Use the Library */
$doc = new Document;
/* Use the XML file from sample4! */
$doc->createFromFile( "domxml_sample4.xml" );
/* Getting the xpath context */
$xpath = $doc->getXPathContext();
/* Retrieving a NodeList of elements with the given id */
$nodes = $xpath->evaluate( "//child::*[@id="HTML"]" );
if ( $nodes->getLength( ) > 0 ) {
$term = $nodes->item( 0 );
$term->setNodeValue( strtoupper( $term->getNodeValue( ) ) ) ;
}
/* Printing the Document */
$doc->printDocument(); ?>
|
|