|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XMl Data Islands
Hello,
I was wondering how you parsed through a second level of an xml file using data islands. i.e. xml example: <blah root> <blah first level> <blah second level> </blah second level> </blah fist level> </blah root> Html example: <xml id="blah" src="blah.xml"></xml> <table datasrc="#blah"> <tr align="center"> <td colspan="14"> <span datafld="blah first level"></span> </td> </tr>..... Does anyone know how to access the value tagged by <blah second level> ? I've tried <span datafld="blah first level//blah second level"></span> <span datafld="blah first level.blah second level"></span> <span datafld="//blah first level/blah second level"></span> amoung others, these pure guesses dont work and I would appreciate if anyone knows how to access data further down the tree. Also as a follow on, are data islands a waste of time or should javascript or vbscript be used instead? Regards Hoggie |
|
#2
|
|||
|
|||
|
Well, I've never really used data islands, but I'd recommend you look into using xsl. It's a little more difficult if your page only has a small section devoted to your data, but it's better supported and more powerful.
|
|
#3
|
|||
|
|||
|
Thanks for that.
XSL is an option but as you pointed out, it is only a small section of the page I need to include the xml data = extra work!!! Thank you for your reply. |
|
#4
|
|||
|
|||
|
i realize i am bringing up an old old topic..but i have the same problem...except i absolutly cannot use xsl becaues the xml file is a feed from weather.com so i can't add the xsl template into the top of the xml file...i have found that my only option is data islands but i'm having trouble getting to the second and third levels without putting tables inside tables inside tables...anyone able to help?
|
|
#5
|
|||
|
|||
|
Take a look at http://lists.xml.org/archives/xml-d...5/msg00741.html. It's not data islands, but it describes a way to do what you're wanting using javascript and xsl on the client side. Plus, you can make it cross-browser, which is a plus in my book (data islands are IE only, as far as I know).
__________________
-james |
|
#6
|
|||
|
|||
|
XML data island
These data islands do not work on Macs at all.
Being that I work for a company that has to be multi-browser compatible, this presents a major problem. here is my xml code: <reunion> <military> <what>Patrol Gunboat Reunion Association</what> <desc>A reunion is planned for Aug. 4-8 in Concord, Calif. for those who served aboard Asheville and Tacoma class boats.</desc> <contact> Contact Terry McManuels, 1673 Kilt St., Virginia Beach, VA 23464.</contact> </military> <military> <what>USS Isle Royale</what> <desc> A reunion is planned for Aug. 5-8 in Biloxi, Miss.</desc> <contact> Contact George Lowell, Box 307, Hatfield, AR 71945.</contact> </military> <reunion> Here is the code i have on an shtml document: <h2>Military reunions</h2><p> <xml id="reunion" src="reunion_military.xml"></xml> <p> <table cellpadding=0 cellspacing=0 border="0" datasrc="#reunion" bgcolor> <tr><td height=10></td></tr> </tr> <tr> <td bgcolor="#000000"><span class="title" datafld="WHAT"></span></td></tr> <tr bgcolor="#c0c0c0"><td><span datafld="DESC"></span><br> <span datafld="CONTACT"></span></td> <tr><td height=10></td></tr> </tr> </table> The page works great on PCs(Netscape and IE) but nothing shows up when I try opening the page on a Mac. Even W3C's data island examples don't work on Macs! Can anyone suggest a solution? Please keep in mind that I'm an amatuer programmer, but I really want to find a solution for this. Also, this file has to be displayed inside an shtml file (or does it?) because it utilizes server-side includes all across our site. I don't know how to get those server-side includes to work on XML files. Any help provided on this matter would be greatly appreciated! jmarx |
|
#7
|
|||
|
|||
|
If cross-browser is as big a concern as you say it is, I'd recommend a server-side solution. That's really the only way to ensure that the client sees what you're expecting. Pretty much any server-side language can handle xml, so find one that looks easy (php is good) and go with that.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XMl Data Islands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|