XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2002, 05:51 AM
Hoggie Hoggie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ireland
Posts: 10 Hoggie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old October 21st, 2002, 11:20 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
  #3  
Old October 22nd, 2002, 05:44 AM
Hoggie Hoggie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ireland
Posts: 10 Hoggie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old July 19th, 2004, 01:20 AM
khag7 khag7 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 khag7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #5  
Old July 19th, 2004, 11:53 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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

Reply With Quote
  #6  
Old July 20th, 2004, 12:13 PM
jmarx jmarx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 jmarx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #7  
Old July 20th, 2004, 04:51 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XMl Data Islands


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT