I have a php script that retrieves an XML file from a database and displays it in html.
I only want to display some parameters from the XML in my html, I was wondering what was the best way to do it.
Suppose that bellow I would only like to display the Format and TIM attributes of the XML. What would I need to modify on the html?
I've read that I can delete elements using XSLT but then I would need to modify the xml in the database, is there another way to do it with just html or xml?
<?xml version="1.0" encoding="UTF-8"?>
<Tagged_date>UTC 2016-03-28 20:21:33</Tagged_date>
<span class="meta-label"> <?php echo $database['XML'] ?> </span> <span class="meta-content">Content</span></li>
To answer to your question: No. Not possible with "just HTML or XML".
However I feel like simply answering your question does not really help you. Thus, here is a way you could handle this in PHP (since your question is tagged with the PHP tag as well): You could use the SimpleXMLElement class, to which constructor you can pass your XML, and then access is pretty simply, like so:
<?php // caution, no valid XML in example! $xmlElement = new SimpleXMLElement('<your><xml><here>'); echo $xmlElement->track->Format