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
<?xml version="1.0" encoding="UTF-8"?>
<File>
<track type="General">
<Format>MPEG-4</Format>
<Codec_ID>mp42</Codec_ID>
<Codec_ID>mp42 (mp42/mp41)</Codec_ID>
<Tagged_date>UTC 2016-03-28 20:21:33</Tagged_date>
<TIM>00:00:00:00</TIM>
<TSC>60000</TSC>
<TSZ>1001</TSZ>
</track>
</File>
Html
<span class="meta-label"> <?php echo $database['XML'] ?> </span> <span class="meta-content">Content</span></li>
Edit: This is a much more specific question than how to parse data, the other topic explains everything but it is not required to know all about XML to do some simple filtering. For people just looking on this specific question leaving it open would be better