SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML: Is this possible

    I am creating a catalog of my cds that I own etc. I have decided to use XML to store the info about each disc. Then make a page to display it with XSL.

    My question is:

    Is it possible to make a form in which when you fill it out it writes the info into the XML file, sorta like adding a new cd to the collection?

    If so how would this be done? Would I need special software installed?

    Thankyou.
    Wavelan

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeap very easy:

    just follow this turorial:

    http://www.xml101.com/articles/micha...ml/default.asp

    there's also a CD catalouge sample XML you can use... as your tutorial:
    http://www.xml101.com/examples/cd_catalog.xml (requires: IE) | http://www.xml101.com/examples/


    for more help visit: http://www.xml101.com/

    Hope this answer you question
    Azizur Rahman
    Web Application Developer

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to do it without ASP ?
    Wavelan

  4. #4
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can try it using MS XML NotePad.

    http://msdn.microsoft.com/library/de...mlpadintro.asp

    this is only free good XML tool I know off so far. its fairly easy to get used to as well.

    XML Spy is best one but really expensive...

    if you are looking fro somingthing like updateing from a HTML form then you'll need to know JavaScriting or VBScripting... and yes it is possible to do... bt requires lot of understanding of all the above.
    Azizur Rahman
    Web Application Developer

  5. #5
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh ok too advanced for me I think

    Thanks anyway
    Wavelan

  6. #6
    SitePoint Member
    Join Date
    May 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php would work too

    You could use php to do this. For example you could have a form that when you post, kills the last line and then appends text to an XML file. For example say you filled out an HTML form with this data:
    artist:Brian Eno
    title:Another Green World
    track[1]:Sky Saw
    track[2]:Over Fire Island
    etc..

    The php would take this data, kill the last line of the file (in this case </albumlist> which is the closing tag of the list) then writes something like this to the file:
    <album>
    <artist>Brian Eno</artist>
    <title>Another Green World</title>
    <track>
    <title>Sky Saw</title>
    </track>
    <track>
    <title>Over Fire Island</title>
    </track>
    etc...
    </album>
    </albumlist>

    You could of course use a lot more information than this. Just loop through the track array like this
    PHP Code:
    foreach ($track as $value){
      if (!empty(
    $value)){
        print 
    your track info to the file
      
    }

    I'd check out all the XML functions in the PHP library too. This (very simple) example doesn't ensure that the file will end up in the correct format if something goes wrong.

  7. #7
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Wavelan
    oh ok too advanced for me I think

    Thanks anyway
    anything and everything can be advanced for anyone and everyone, but once you take a step into doing it, things are not that hard and not that advaced or complicated either, its just what we think is hard not not trying hard for it makes it even hard.
    Azizur Rahman
    Web Application Developer

  8. #8
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't want to use (my)SQL for storage, you might want to try this thing out:

    http://dbx.idya.net/

    <i>DBX is essentially a full fledged database system.

    It is completely written in PHP, and works using XML files as its native format. The database can be queried using standard SQL queries. DBX is the smallest, platform independent DBMS and is extremely easy to migrate to. For small databases, it is a good substitute for mySQL, Oracle, etc. The added advantage is that it saves the data as neat, readable, XML files - allowing easy compatibility.</i>


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
  •