5 Replies Latest reply on Oct 31, 2008 2:44 PM by blueprnt

    Can I an html file to generate a xml file?

    back-.space
      Is it passable to have a html document that the user selects different files to be added, and different options for the files. Then generates an xml file for uploading?
      All help much appreciated :)
        • 1. Re: Can I an html file to generate a xml file?
          Level 7
          back-.space wrote:
          > Is it passable to have a html document that the user selects different files to be added, and different options for the files. Then generates an xml file for uploading?

          HTML cannot generate XML, but it can create a form that is submitted to
          a server-side script that generates the XML. However, to be able to
          create it, you need a web server that supports a server-side language
          such as PHP - and the knowledge of how to write the script that creates
          the XML.

          PHP 5 has a feature called XMLWriter which does exactly what you want.
          However, without a reasonable grasp of PHP and XML, you'll find it
          difficult to understand.

          http://docs.php.net/manual/en/book.xmlwriter.php

          --
          David Powers, Adobe Community Expert
          Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
          Author, "PHP Solutions" (friends of ED)
          http://foundationphp.com/
          • 2. Re: Can I an html file to generate a xml file?
            back-.space Level 1
            Hmmm well what about a text file? (with the xml code incerted)
            Below is the type of code I need to generate with the clients input in {} this could be a text file that I then convert to xml.
            Thanks for all your help :)

            <GenresToAddList>
            - <GenreToAdd>
            <GenreName>Classic Hits</GenreName>
            <MediaClass>MUSIC</MediaClass>
            <ImageFile>classic hits.jpg</ImageFile>
            </GenreToAdd>
            </GenresToAddList>
            - <SongsToAddList>
            - <SongToAdd>
            <Title> {entered by user} </Title>
            <Artists> {entered by user} </Artists>
            <SongID> {auto incremented} </SongID>
            <MediaClass>MUSIC</MediaClass>
            <MediaFormat>MPEG1</MediaFormat>
            <MediaType> {selected by user} </MediaType>
            <ImageFile> {location entered by user} </ImageFile>
            <MusicFile> {location entered by user} </MusicFile>
            - <GenreList>
            <Genre>Classic Hits</Genre>
            </GenreList>
            <DateReleased> {entered by user}</DateReleased>
            <BeatsPerMinute> {entered by user}</BeatsPerMinute>
            <CDCatalogNumber> { auto incremented} </CDCatalogNumber>
            </SongToAdd>
            </SongsToAddList>
            • 3. Re: Can I an html file to generate a xml file?
              CaryD Level 2
              Wouldn't make a difference as xml files are text files.
              • 4. Re: Can I an html file to generate a xml file?
                Level 7
                CaryD wrote:
                > Wouldn't make a difference as xml files are text files.

                Precisely. If you have the skill to produce one, you can do the other.
                Unfortunately, it's not the sort of thing that you can pick up from a
                "quick script" or answer in an online forum.

                --
                David Powers, Adobe Community Expert
                Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
                Author, "PHP Solutions" (friends of ED)
                http://foundationphp.com/
                • 5. Re: Can I an html file to generate a xml file?
                  blueprnt
                  quote:

                  Originally posted by: CaryD
                  Wouldn't make a difference as xml files are text files.

                  Yes I agree.
                  I have been manualy producing this code twenty at a time once a month, but now I need to do 1000 at a time and need a more efficent way of doing it, and lettting the user input the data, then produce a xml file or text document, but as David Powers said this can not be doen with out doing it server side, which would not be possable this time because they want to be able to produce it out in the feild, with out web access. I would even be happy to display it on screen, then cut and paste to a txt file.