convert to XML

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
vladabgd
Forum Newbie
Posts: 1
Joined: Fri Jun 05, 2009 9:59 am

convert to XML

Post by vladabgd »

Here is the problem. I have this:

Code: Select all

http://webservices.nbs.rs/Communication ... .asmx?WSDL
And I need some kind of php code to create output from that to this:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
- <DataSet xmlns="http://www.bnr.ro/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bnr.ro/xsd nbrfxrates.xsd">
- <Header>
  <Sender>National Bank of Romania</Sender> 
  <SendingDate>2009-06-05</SendingDate> 
  <MessageType>DR</MessageType> 
  </Header>
- <Body>
  <Subject>Reference rates</Subject> 
  <OrigCurrency>RON</OrigCurrency> 
- <Cube date="2009-06-05">
  <Rate currency="AED">0.8094</Rate> 
  <Rate currency="AUD">2.3895</Rate> 
  <Rate currency="BGN">2.1542</Rate> 
  <Rate currency="BRL">1.5332</Rate> 
  <Rate currency="CAD">2.6937</Rate> 
  <Rate currency="CHF">2.7751</Rate> 
  <Rate currency="CNY">0.4350</Rate> 
  <Rate currency="CZK">0.1558</Rate> 
  <Rate currency="DKK">0.5657</Rate> 
  <Rate currency="EGP">0.5310</Rate> 
  <Rate currency="EUR">4.2132</Rate> 
  <Rate currency="GBP">4.7690</Rate> 
  <Rate currency="HUF" multiplier="100">1.4603</Rate> 
  <Rate currency="INR">0.0630</Rate> 
  <Rate currency="JPY" multiplier="100">3.0713</Rate> 
  <Rate currency="KRW" multiplier="100">0.2375</Rate> 
  <Rate currency="MDL">0.2658</Rate> 
  <Rate currency="MXN">0.2251</Rate> 
  <Rate currency="NOK">0.4698</Rate> 
  <Rate currency="NZD">1.8909</Rate> 
  <Rate currency="PLN">0.9285</Rate> 
  <Rate currency="RSD">0.0448</Rate> 
  <Rate currency="RUB">0.0966</Rate> 
  <Rate currency="SEK">0.3859</Rate> 
  <Rate currency="TRY">1.9269</Rate> 
  <Rate currency="UAH">0.3899</Rate> 
  <Rate currency="USD">2.9721</Rate> 
  <Rate currency="XAU">93.3490</Rate> 
  <Rate currency="XDR">4.6373</Rate> 
  <Rate currency="ZAR">0.3689</Rate> 
  </Cube>
  </Body>
  </DataSet>
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: convert to XML

Post by mikemike »

You can use PHP's SOAP library to create a client that reads valid WSDL web services. http://developer.apple.com/internet/web ... apphp.html See the section marked 'A SOAP Client'
Post Reply