creating a URL from multiple XML fields

admin

Administrator
Staff member
Hi, I'm new to XML so go easy...

:confused:

I am loading an XML document to be displayed as a table in HTML. I want to create a hyperlink from two or more of the XML fields. I can do it with one or the other, but can't work out how to join them. I think it is possible in javascript, but can't work out how to do it.

The XML is structured like this:

<Airfares>
<LINKPREFIX>http://linkprefix.com?a=1&b=2&url=</LINKPREFIX>
<LINKSUFFIX>&id=567</LINKSUFFIX>
<OFFER>
<PRICE>?60</PRICE>
<URL>http://www.destination-url.com</URL>
</OFFER>
</Airfares>

The composite URL from these fields would be:

<!-- m --><a class="postlink" href="http://linkprefix.com?a=1&b=2&url=http://www.destination-url.com&id=567">http://linkprefix.com?a=1&b=2&url=http: ... com&id=567</a><!-- m -->


The HTML I am using is:

<xml id="datafeed" src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.xyz.com/flights.xml"
async="false"></xml>
<table border="0" datasrc="#datafeed" datafld="OFFER" cellpadding="1" id=flightoffers>
<tr>
<td align=right><a datafld="LINKPREFIX" datasrc="#datafeed">
<span datafld="PRICE"></span></a></font>
</td>

</tr>
</table>

What do I need to do?
 
Back
Top