Hello,
I'm trying to create exchange rates list with the data source of my National Bank, and my national Bank make it very complicated, data are stored with SOAP, and first of all I made rate.php that pull and show all data from web service od National Bank but like this:

182 21.09.2012 21.09.2012 31.12.4172 3 2 978 978 EUR EuroEMU EMU 1 0.0000 12.2809 0.0000 0.000000 182 21.09.2012 21.09.2012 31.12.4172 3 3 36 036 AUD Australian Dollar Australia 1 0.0000 10.9310 0.0000 0.000000 182 21.09.2012 21.09.2012 31.12.4172 3 3 124 124 CAD

But when I go to page source I can see that data is XML:

<ExchangeRateDataSet>
  <ExchangeRate>
    <ExchangeRateListNumber>182</ExchangeRateListNumber>
    <Date>21.09.2012</Date>
    <CreateDate>21.09.2012</CreateDate>
    <DateTo>31.12.4172</DateTo>
    <ExchangeRateListTypeID>3</ExchangeRateListTypeID>
    <CurrencyGroupID>2</CurrencyGroupID>
    <CurrencyCode>978</CurrencyCode>
    <CurrencyCodeNumChar>978</CurrencyCodeNumChar>
    <CurrencyCodeAlfaChar>EUR</CurrencyCodeAlfaChar>
    <CurrencyNameEng>Euro</CurrencyNameEng>
    <CountryNameEng>EMU</CountryNameEng>
    <Unit>1</Unit>
    <MiddleRate>12.2809</MiddleRate>
  </ExchangeRate>
  <ExchangeRate>
    <ExchangeRateListNumber>182</ExchangeRateListNumber>
    <Date>21.09.2012</Date>
    <CreateDate>21.09.2012</CreateDate>
    <DateTo>31.12.4172</DateTo>
    <ExchangeRateListTypeID>3</ExchangeRateListTypeID>
    <CurrencyGroupID>3</CurrencyGroupID>
    <CurrencyCode>36</CurrencyCode>
    <CurrencyCodeNumChar>036</CurrencyCodeNumChar>
    <CurrencyCodeAlfaChar>AUD</CurrencyCodeAlfaChar>
    <CurrencyNameEng>Australian Dollar</CurrencyNameEng>
    <CountryNameEng>Australia</CountryNameEng>
    <Unit>1</Unit>
    <MiddleRate>10.9310</MiddleRate>
  </ExchangeRate>
...
...
...
...
</ExchangeRateDataSet>

Now I want to show only a few rows from the given data, that is "<Date>" and "<MiddleRate>" and to add them to table thet will be like this:

    <div>
    <p><b>-->> XML row <Date> <<--</b></p>
    <table>
    <tbody><tr>
    <td>EUR</td><td>-->> XML row <MiddleRate> <<--</td></tr>
    <td>USD</td><td>-->> XML row <MiddleRate> <<--</td></tr>
    <td>CHF</td><td>-->> XML row <MiddleRate> <<--</td></tr>
    <td>GBP</td><td>-->> XML row <MiddleRate> <<--</td></tr>
    <td>AUD</td><td>-->> XML row <MiddleRate> <<--</td></tr>
    <td>CAD</td><td>-->> XML row <MiddleRate> <<--</td></tr>

    </tbody></table>
    </div>

It does not have to appear on the page rate.php that show list of currencies (but it would be best for me) I might as well create a new php that pulled data from rate.php.

Is it possible?
Thanks in advance for your time for my problem.

Have a look at SimpleXML or DOMDocument.

commented: SimpleXML solved my problem. +0

I've heard about SimpleXML but I could not do that I've shown above, I do not understand SimpleXML very well. I've heard that those who have managed to do it that they used Parsing but for me it's all unknown, I tried to do something more with looking for tutorials on web but still without success. It also confuses me that php is actually xml.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.