Page 1 of 1

XML binding data with HTML

Posted: Tue Dec 19, 2006 9:58 pm
by sarris
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi there...I am looking through the internet for hours now to find the simplest thing to do.
I want to get the data out of my xml file and all the tutorials have examples on how to throw all your data into a table.
I just want to access the data, and get some values out of it
Lets say i have this xml file

[syntax="xml"]<CATALOG>
	<CD id = '1'>
		<TITLE>Empire Burlesque</TITLE>
		<ARTIST>Bob Dylan</ARTIST>
		<COUNTRY>USA</COUNTRY>
		<COMPANY>Columbia</COMPANY>
		<PRICE>10.90</PRICE>
		<YEAR>1985</YEAR>
	</CD>
	<CD id = '2'>
		<TITLE>Hide your heart</TITLE>
		<ARTIST>Bonnie Tyler</ARTIST>
		<COUNTRY>UK</COUNTRY>
		<COMPANY>CBS Records</COMPANY>
		<PRICE>9.90</PRICE>
		<YEAR>1988</YEAR>
	</CD>
</CATALOG>
And i want to, lets say, when the user selects id = 1 on a combo box on the html page, to show the year of cd with id = 1, on a text box...
How can i do that? Its so weird that there is no plain explenation bout that somewhere arround the tutorials.
Thanks for anything you can do


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Dec 19, 2006 10:14 pm
by feyd
Assuming you've found the XML libraries available in PHP to import the XML data as an array, you can utilize the tutorial posted by CoderGoblin.

Moved to PHP - Code.

Posted: Thu Dec 21, 2006 6:03 pm
by volka
Maybe it's not about php code but data binding and xml islands in the Internet Explorer.
If so then the answer to
sarris wrote:Its so weird that there is no plain explenation bout that somewhere arround the tutorials.
is: because there is no such data binding available, see http://msdn.microsoft.com/workshop/auth ... nsumer.asp

Posted: Thu Dec 21, 2006 9:36 pm
by sarris
there is such bindin.i managed to do it in the end.
with the XMLHTTP request
Thanks anyways.

Posted: Fri Dec 22, 2006 4:10 am
by volka
Ah ok, that are two different things but anyways. Fine if it works for you ;)