Discussion in 'Web Design and Development' started by GhostDZ9, Nov 5, 2010.

  1. GhostDZ9 macrumors regular

    Sep 13, 2010
    Hey guys,

    I'm creating a news update part to my CMS and I was wondering is it possible to have users enter there information into an html form, the info that they entered is then translated into an XML document which can later be parsed using jQuery and displayed on the site?

    if there is a way to do this can you please let me know?
  2. elppa macrumors 68040


    Nov 26, 2003
    Yes. You can do that. Just take the user input and convert it into a valid xml document. How you go about this exactly will depend on the server side technology you are using, although most languages have a library (often built in) with good support for xml parsing/writing.
  3. GhostDZ9 thread starter macrumors regular

    Sep 13, 2010
    what I meant by that was can it be done automatically? if so how do i do this?
  4. lucidmedia macrumors 6502a

    Oct 13, 2008
    Wellington, New Zealand
    elppa actually answered your question as far as it can be answered given the information you have provided. How you go about this is dependent on your server-side technologies...

    For example, if you can use PHP on your server, google "PHP, save as XML" and you will find a handful of tutorials. The link below looked pretty good:

    you already mentioned JQuery. You can also use that to format and prepare your XML, then save it via PHP.

    Of course, if you have a CMS already, why are you saving files to disk? It would be better to use your CMS's API and save this content into a database table.
  5. GhostDZ9 thread starter macrumors regular

    Sep 13, 2010
    I am programming my own CMS, I'm doing this all using local host on mac, I'm aware of how to do via PHP but i was just wondering if you can do it from html to XML directly without having to use PHP
  6. Ride9650 macrumors 6502

    Jun 29, 2007
    no..well technically yes, you don't have to use php, BUT you do have to process it somehow.

    Though it doesn't return xml, the closest thing to automatic processing is probably using PHP's json_encode function.
  7. GhostDZ9 thread starter macrumors regular

    Sep 13, 2010

Share This Page