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 April 19th, 2004, 02:41 PM
funfone funfone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 funfone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Please Be Gentle With Me :)

I have the following example feed that I am trying to display on a standard web page.

I have read lots about XML but I am finding it hard to get a grip on exactly what is needed.

Any pointers as to the html file needed to bring this information into the web page is greatly appreciated. Also I have hosted web space so the server is limited to what I can place on it.

Here is the feed.

Thankyou for your time any any advide you can give me.

Quote:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE soccer (View Source for full doctype...)>
- <soccer>
- <cp id="15" nm="ENGLAND: Premier League" dt="2003-11-08">
- <gm id="28386" tm="13:30" c1="Wolves" c2="Birmingham">
<sr ss="FT" r1="1" r2="1" />
<ev pl="Stefan Iversen" tp="goal" mt="66" cb="1" />
<ev pl="Mikael Forssell" tp="goal" mt="49" cb="2" />
</gm>
- <gm id="28385" tm="16:00" c1="Portsmouth" c2="Leeds United">
<sr ss="FT" r1="6" r2="1" />
<ev pl="Dejan Stefanovic" tp="goal" mt="17" cb="1" />
<ev pl="Gary ONeil" tp="goal" mt="45" cb="1" />
<ev pl="Hayden Foxe" tp="goal" mt="63" cb="1" />
<ev pl="Gary ONeil" tp="goal" mt="71" cb="1" />
<ev pl="Patrick Berger" tp="goal" mt="75" cb="1" />
<ev pl="Aiyegbeni Yakubu" tp="goal" mt="86" cb="1" />
<ev pl="Alan Smith" tp="goal" mt="19" cb="2" />
</gm>
- <gm id="28384" tm="16:00" c1="Charlton Athletic" c2="Fulham">
<sr ss="FT" r1="3" r2="1" />
<ev pl="Graham Stuart" tp="goal" mt="10" cb="1" />
<ev pl="Jonatan Johansson" tp="goal" mt="69" cb="1" />
<ev pl="Jonatan Johansson" tp="goal" mt="76" cb="1" />
<ev pl="Sean Davis" tp="goal" mt="89" cb="2" />
</gm>
- <gm id="28383" tm="16:00" c1="Bolton Wanderers" c2="Southampton">
<sr ss="FT" r1="0" r2="0" />
<ev pl="Michael Svensson" tp="rc" mt="86" cb="2" />
</gm>
- <gm id="28382" tm="16:00" c1="Aston Villa" c2="Middlesbrough">
<sr ss="FT" r1="0" r2="2" />
<ev pl="Boudewijn Zenden" tp="goal" mt="30" cb="2" />
<ev pl="Michael Ricketts" tp="pen" mt="49" cb="2" />
</gm>
- <gm id="28381" tm="16:00" c1="Arsenal" c2="Tottenham Hotspur">
<sr ss="FT" r1="2" r2="1" />
<ev pl="Robert Pires" tp="goal" mt="69" cb="1" />
<ev pl="Fredrik Ljungberg" tp="goal" mt="79" cb="1" />
<ev pl="Darren Anderton" tp="goal" mt="4" cb="2" />
</gm>
</cp>
- <cp id="13" nm="ITALY: Serie A" dt="2003-11-08">
- <gm id="28196" tm="18:00" c1="Sampdoria" c2="Empoli">
<sr ss="FT" r1="2" r2="0" />
<ev pl="Fabio Bazzani" tp="goal" mt="21" cb="1" />
<ev pl="Cristiano Doni" tp="goal" mt="27" cb="1" />
</gm>
- <gm id="28197" tm="20:30" c1="Brescia" c2="Bologna">
<sr ss="1T" r1="0" r2="0" />
</gm>
</cp>
- <cp id="14" nm="SPAIN: Primera Division" dt="2003-11-08">
- <gm id="28405" tm="19:30" c1="Atletic" c2="Espanyol">
<sr ss="2T" r1="1" r2="0" />
<ev pl="Andoni Iraola" tp="goal" mt="15" cb="1" />
</gm>
- <gm id="28406" tm="19:30" c1="Zaragoza" c2="Celta">
<sr ss="2T" r1="1" r2="1" />
<ev pl="Leonardo Ponzio" tp="goal" mt="7" cb="1" />
<ev pl="Saenz Jose Ignacio" tp="goal" mt="3" cb="2" />
</gm>
<gm id="28407" tm="21:30" c1="Deportivo" c2="Real Sociedad" />
</cp>
</soccer>

Reply With Quote
  #2  
Old April 20th, 2004, 09:29 AM
funfone funfone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 funfone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Any ideas anyone at all please

Reply With Quote
  #3  
Old May 7th, 2004, 08:24 AM
wendra wendra is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Germany
Posts: 14 wendra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What are your aims? Do you want to use the XML data for the HTML file? In that case, perhaps you should try to find XML Data Island or Transformnode in some search engine to find some more clues. Or why don't you search it in this forum?

Did it help you?

Last edited by wendra : May 10th, 2004 at 02:10 AM.

Reply With Quote
  #4  
Old May 7th, 2004, 10:12 AM
khwang's Avatar
khwang khwang is offline
Über nübe
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Babylon 4
Posts: 240 khwang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 27 sec
Reputation Power: 6
I just made a simple XSL to go with your XML:
Code:
<xsl:stylesheet version="1.0"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" 
          doctype-public="-//W3C//DTD XHTML 1.1//EN" 
          doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>

  <xsl:template match="soccer"><!--root-->
  <html>
    <head>
      <style type="text/css">
        <xsl:comment>
        body {font-family:verdana;font-size:10px;}
        .ken {background-color:#ebebeb;}
        .header {background-color:#cbcbcb;}
        </xsl:comment>      
      </style>
    </head>
  
    <body>
      <xsl:for-each select="cp">
        <table border="0" cellpadding="2" cellspacing="1">
            <tr>
              <td colspan="2" class="header" align="center">
              <xsl:value-of select="@nm" />
              </td>
            </tr>

            <xsl:for-each select="gm">
            <tr>
              <td width="150">
              <xsl:value-of select="@c1" />
              </td>
              
              <td width="150" class="ken">
              <xsl:value-of select="@c2" />
              </td>
            </tr>
            </xsl:for-each>      
        </table>
        <br />
      </xsl:for-each>
    </body>
  </html>
  </xsl:template>
</xsl:stylesheet>


I gave it a filename of soccer.xsl

Then in your XML doc you add this to the top:

Code:
<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet href="soccer.xsl" type="text/xsl"?>


I did more work on it, so if you want a fancier XSL you can PM me.
__________________
Hello, old friend...

Last edited by khwang : May 7th, 2004 at 02:32 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Please Be Gentle With Me :)


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 2 hosted by Hostway
Stay green...Green IT