Results 1 to 13 of 13

Thread: Starting with XML

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Rotterdam
    Posts
    19

    Starting with XML

    Hi there,

    I am new to XML and basically want to know how I can set it up on a web server, so I can start serving XML based data.

    I have a whole heap of XML files, but when I load them in Explorer, they just present me with the raw code.

    Is there a form of engine that needs to be run on a web server in order to present the data.

    Cheers,

    Ben

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    You have to make a css file to parse the code for you or use a XSLT file.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Rotterdam
    Posts
    19

  4. #4
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Yeah, I know how you feel, im just getting into it too. I bught a book yesterday and so far its seems simple enough.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  5. #5
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    exactly why would you bother with XML ? its useless unless used for cross-platform developement and sharing site configurations with others. unless you absoltely need it i wouldnt bother learning it at all

    I have a whole heap of XML files, but when I load them in Explorer, they just present me with the raw code.
    to be able to transform it into html, people generally use XSL which basically apply's html elements to the XML whilst still offering pain and suffering in the process.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Rotterdam
    Posts
    19
    Well

    It is a project that I have been set to do at work. We need to implement these XML files to share data with a NOC.

    I no little more, but I would like to learn how to implement it so I keep my job

  7. #7
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Yeah that is a good reason.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Rotterdam
    Posts
    19
    So...I guess that's a firm *no* for offers of help

  9. #9
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    doesn't mean that we won't help u out.

    Post an example of one of the xml files and we'll put together a simple xslt for you. Also try downloading the msxml4 sdk from microsoft. They have some beginner stuff on xslt and xpath. This will help spans, trust me.

    Here's something to get you started. This is taken from the msxml4 sdk:

    Code:
    XML (hello.xml)
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="hello.xsl"?>
    <hello-world>
       <greeter>An XSLT Programmer</greeter>
       <greeting>Hello, World!</greeting>
    </hello-world>
    
    XSLT (hello.xsl)
    <?xml version="1.0"?>
    <xsl:stylesheet 
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="1.0">
       <xsl:template match="/hello-world">
           <HTML>
             <HEAD>
               <TITLE></TITLE>
             </HEAD>
             <BODY>
                <H1><xsl:value-of select="greeting"/></H1>
                <xsl:apply-templates select="greeter"/>
             </BODY>
           </HTML>
       </xsl:template>
       <xsl:template match="greeter">
           <DIV>from 
               <I><xsl:value-of select="."/></I>
           </DIV>
       </xsl:template>
    </xsl:stylesheet>

  10. #10
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    Sweet example shunt I might pick up on that actually

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Rotterdam
    Posts
    19
    I got it to work. However I could have done that with about 2 lines of HTML. So I don't get why a more complex weighty language is better than HTML. Anyway not to worry, I have to get this done I guess.

    I've got about 10 pages of XML 'schema' I don't think posting it up would help. Would it?

    Thanks for your time, much welcomed

  12. #12
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    take a look here

    http://www.w3schools.com/xml/

    <edit>be sure to check out data islands</edit>

    ubunreal69 -- I would much rather deal with xml than databases.
    for me: xml - faster and more reliable, no more database connection problems

  13. #13
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    Junior,

    The example was one that showed how to use xslt not why you should use it. In any case, xml is used to transport and describe data. So it should be used in this context.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width