SitePoint Sponsor

User Tag List

Results 1 to 24 of 24

Thread: What is XML?

Hybrid View

  1. #1
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What is XML?

    Does a server need to have it to have XML? Is it installed in the computer of the user or the server? When did XML evolved? How do you do XML? I heard it can work with PHP.
    The Star Circle Quest Community - Community website for SCQ fans.
    Telebisyon.net - Reference guide to TV series shown in the Philippines.
    Lyrics Server Online! - All the lyrics you can get on one website.

  2. #2
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


  3. #3
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Thanks for the link but I did not find any answer if it is base on the computer of the user or the server? I mean, like javascripts which depends on the user's computer and like PHP which depends on the host of the site.
    The Star Circle Quest Community - Community website for SCQ fans.
    Telebisyon.net - Reference guide to TV series shown in the Philippines.
    Lyrics Server Online! - All the lyrics you can get on one website.

  4. #4
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A quote from the page I sent you:

    XML is a markup language much like HTML.


  5. #5
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow

    So basically everyone can see a page with XML in it?
    The Star Circle Quest Community - Community website for SCQ fans.
    Telebisyon.net - Reference guide to TV series shown in the Philippines.
    Lyrics Server Online! - All the lyrics you can get on one website.

  6. #6
    SitePoint Addict five40's Avatar
    Join Date
    Jul 2001
    Location
    Imatra, Finland
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is XML?

    Originally posted by friend_al_23
    Does a server need to have it to have XML? Is it installed in the computer of the user or the server? When did XML evolved? How do you do XML? I heard it can work with PHP.
    It works both on server-side and client-side. In order to process XML on the client side you need a browser which supports XML. At this point at least IE6 and Netscape 6.x are supporting it (don't ask me how good the support is). In order to make XML data available for other browsers you should transform the XML data to HTML on the server side. This is done by using XSLT and some other language, like Java, PHP, ASP ... In general this is better option since browsers XML support is still pretty weak. If you want to learn XML, follow the link Winged Spider gave you.
    Last edited by five40; Dec 20, 2001 at 16:55.
    "-Surely you can't be serious ?
    -Yes I am serious...and don't call me Shirley."

  7. #7
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you! That's the answer I've been looking for. Anyway, here's my interpretation from what you. Correct me if I'm wrong.

    ----------------
    XML can only be used in the latest version of IE and Netscape browsers since they are the only one that supports it. You make the code and then try to convert it in the server using the said application into PHP, ASP, JSP, etc.
    ---------------
    The Star Circle Quest Community - Community website for SCQ fans.
    Telebisyon.net - Reference guide to TV series shown in the Philippines.
    Lyrics Server Online! - All the lyrics you can get on one website.

  8. #8
    Are you ready for BSD? Marshall's Avatar
    Join Date
    Dec 2001
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    friend_al_23 says:
    XML can only be used in the latest version of IE and Netscape browsers since they are the only one that supports it. You make the code and then try to convert it in the server using the said application into PHP, ASP, JSP, etc.
    XML is a format for schematically representing data. It can be used for multiple purposes in any number of applications. In most cases the user does not view XML directly -- instead, a front-end is created to display the information represented by the XML object in a manner compatible with a specific medium. NASA, for instance, is using a subset of XML to control satellites in space. On the Internet you might use XML to distribute news feeds. The client's server would retrieve the XML object from the news feed server and parse it into HTML code that matches their Website layout.

    - Marshall

  9. #9
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    It took me quite a while to figure out what the hell XML was.

    XML itself is very simple. It's just a text file that looks like this:

    <?xml version="1.0"?>
    <me>
    <name>John Doe</name>
    <address>94, Main Street, Nowheresville 16463, XY</address>
    <tel>738 2838</tel>
    <email>johndoe@black.hole.com</email>
    <url>http://www.unknown_and_unsung.com/</url>
    </me>


    It's pure data, along with tags that describe what kind of data it is. I.e. the <name> tag defines "John Doe" as name data.

    XML is mostly useful for transferring data between different systems, since it's totally platform independent.

    It can also be used to format web pages, using XSL. XSL is kind of like a very advanced style sheet. You write an XML file with the content, and a XSL file which contains the design, and then, you smack them together, and viola! A web page!

    The latest browsers can put XML and XSL together, but it's much better to let the server do it before it is sent to the user (as XHTML).

    Devshed has a great tutorial on how to create a XHTML page from an XML file and a XSL file:
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  10. #10
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    How long exactly did it take you to learn XML? Did you learn it on your own? If yes, how?
    The Star Circle Quest Community - Community website for SCQ fans.
    Telebisyon.net - Reference guide to TV series shown in the Philippines.
    Lyrics Server Online! - All the lyrics you can get on one website.

  11. #11
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by friend_al_23
    How long exactly did it take you to learn XML? Did you learn it on your own? If yes, how?
    Like I said, XML is just a plain text file with custom tags. There is really nothing to learn about it, except what it is. What you can learn is to interpret it and parse it, which is different in every application.

    Slashdot provides XML feeds of it's news, for instance. Apaches config files are in XML format. Socket connections in Flash are done by sending the data in XML format. There are many different applications of XML, and LOTS of ways to parse and use it.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  12. #12
    SitePoint Addict five40's Avatar
    Join Date
    Jul 2001
    Location
    Imatra, Finland
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by truelight


    Like I said, XML is just a plain text file with custom tags. There is really nothing to learn about it, except what it is. What you can learn is to interpret it and parse it, which is different in every application.

    I would say there is actually lot's to learn before you can say you master XML. Doing a well formed XML document is pretty straightforward, but what about adding some DTD/Schemas ? What about XPath, DOM, XSL ...

    friend_al_23 : You asked how long it's gonna take to learn it. This ofcourse depends. I would say I'm still learning it and the learning curve has been quite long but only because my studying has been quite occasional. You should first check out tutorials about XML like the one Winged Spider told you. Others might be Zvon.org, WDVL or XMLDir. Then you might just want to buy a book about XML if you get more interested about it.
    Last edited by five40; Dec 22, 2001 at 08:55.
    "-Surely you can't be serious ?
    -Yes I am serious...and don't call me Shirley."

  13. #13
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by five40


    I would say there is actually lot's to learn before you can say you master XML. Doing a well formed XML document is pretty straightforward, but what about adding some DTD/Schemas ? What about XPath, DOM, XSL ...
    Oh, yes, of course. XML in itself is very easy, but as I said, there are lots of ways to treat XML, such as Xpath, DOM and XSL, indeed. However, there is nood need to know any of those to use XML, really. It has lots and lots of applications.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  14. #14
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A little clarification:

    XML is a data markup format, not a language, and it is mostly theory, not implementation.

    XML can come in many forms, from AIML to VoiceML, where each format is a set of tags that control a certain type of data. You can write your own XML formats as well.

    Do not confuse the use of XSL and DTDs with XML itself, as they are assistance providers to XML formats. A DTD is most often used for validation of an XML format, making it possible for many systems to understand a single XML format, like RSS, for example. A DTD is not required for any XML format, particuarly if you only use the XML yourself, but if you plan on letting other people read your XML schema, make a DTD, it is handy.

    As Marshall said, XML is rarely seen by users. It was created to be completely machine readable, and not user dependent.

    The most prevalant forms of XML seems to be RSS & RDF - 2 flavors of headline syndication schemas, which enable sites to easily share headlines with other sites. VoiceML is going to be a big XML format in the near future, as more sites comply with accessibility standards, etc.

    If you do HTML (by HAND), then you pretty much know XML theory. Then it is a matter of learning how each XML schema is used. If you are writing a validator, then you would want to learn about DTDs and well-formedness, etc. Learning XSL and things like that is another matter entirely, and really don't have anything to do with learning XML per se.

    The language you choose to use with XML is purely a matter of just that, a choice. Just like you choose what HTML editor you like to use, you can select with language you deal with XML in. You can write XML by hand, just like HTML, you can use scripts to read and write XML, or you can write programs to do it. It is a matter of preference and implementation. Just about every language can deal with XML, in one way or another, from ASP to Python.
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  15. #15
    SitePoint Zealot jonsteele's Avatar
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi everyone,

    Just a question expanding on the topic:

    I'm thinking of redoing a table of contents for an HTML document, which has subsections within subsections, kinda like:
    Code:
    1 - Section 1
        A - Subsection 1
        B - Subsection 2
        C - Subsection 3
            i - Subsubsection 1
            ii - Subsubsection 2
        D - Subsection 4
    2 - Section 2
        A - Subsection 1
        ...
    and so on. Currently this is in plain html, making updating a pain.

    I was thinking of using a database, but it seems like an overkill.

    Would XML be the solution? It looks like nesting subsections within sections seems to fit right it, but would using XML actually achieve anything (i.e. easier maintenance)? And how easy would it be for PHP to parse it into HTML?

    I am just deciding whether or not it is worth it.

    I too am pretty new to XML.

    Thanks,
    Jon

  16. #16
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Truelight,

    I'd love to see you write an article giving examples of how to use XML, including not only a sample of an XML markup page but HOW one would go about using XSL (or similar) interpreter. Is this a script? Can anyone use it? Does a host have to install it or can Joe Scmoe use it? Etc.

    I am fascinated by XML and want to use it. I don't know that I have the ability to install XSL on my server as I cannot install APPS (I don't think). I can install scripts and code and if it's a matter of copying something to a server, I can do that. Running an executable on a server I don't think I have permission to do. Clarifications of details like this would make for an awesome article for the Crier!

    Email Nicky at crier@sitepoint.com if you're interested.

    Sketch
    Aaron Brazell
    Technosailor



  17. #17
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kev did a good thread about PHP + XML + XSLT recently, so I think an article for the crier would be a bit of a duplication really.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  18. #18
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Sketch
    Truelight,

    I'd love to see you write an article giving examples of how to use XML, including not only a sample of an XML markup page but HOW one would go about using XSL (or similar) interpreter. Is this a script? Can anyone use it? Does a host have to install it or can Joe Scmoe use it? Etc.

    I am fascinated by XML and want to use it. I don't know that I have the ability to install XSL on my server as I cannot install APPS (I don't think). I can install scripts and code and if it's a matter of copying something to a server, I can do that. Running an executable on a server I don't think I have permission to do. Clarifications of details like this would make for an awesome article for the Crier!

    Email Nicky at crier@sitepoint.com if you're interested.

    Sketch
    Whoa - thank you for you confidence in me. I'm in no way a XML lord, but I could probably write an article on how to "merge" an XML file and a XSL slylesheet into HTML using PHP. It's not very hard, really.

    The best/most simple way yo do this is using Sablotron engine for PHP. You just install sablotron on the server, and then do this:

    PHP Code:
    <?php

    $xml 
    join(''file('thexmlfile.xml'));
    $xsl join(''file('thexslfile.xsl'));

    xslt_process($xsl$xml$result);

    echo 
    $result;
    ?>
    And viola - you have an HTML page! I find this to be the best way to process XML and XSLT.

    If you can't install software on your host (or make them to), and you wish to use XML, you should switch to another host. If that is not a possibility,
    you could parse the XML using something called expat functions. However, this is not efficient, and hard as hell, and I have not personally figured out how to do it myself.

    I'll contact Nicky about the article, to see if anyone is interested.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  19. #19
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Karl
    Kev did a good thread about PHP + XML + XSLT recently, so I think an article for the crier would be a bit of a duplication really.
    Ah, oops - responded a bit too quick there. Where can I find this thread?
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  20. #20
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Montréal, Québec
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    off topic...

    Hey Truelight, thanks for everything but I just wanted to say it's spelled "Voilà" and not "Viola"

    in fact, viola is "rape" in past tense, lol!
    ...gravity always wins...

  21. #21
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: off topic...

    Originally posted by Tchendoh
    Hey Truelight, thanks for everything but I just wanted to say it's spelled "Voilà" and not "Viola"
    You learn something new every day!

    in fact, viola is "rape" in past tense, lol!
    Ah, that would explain why Word XP didn't correct it for me.
    Last edited by M. Johansson; Jan 6, 2002 at 20:49.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  22. #22
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good article on XML for all those that are interested.

    http://www.alistapart.com/stories/hellxml/


  23. #23
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,811
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: off topic...

    Originally posted by Tchendoh
    Hey Truelight, thanks for everything but I just wanted to say it's spelled "Voilà" and not "Viola"

    in fact, viola is "rape" in past tense, lol!
    Isn't it a small stringed orchestral instrument?

    Nez Pah?
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  24. #24
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know of a good book about XML or XHTML for beginners?
    Wavelan


Bookmarks

Posting Permissions

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