Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

write to xml [online]

Options
  • 10-12-2007 11:09pm
    #1
    Registered Users Posts: 8,070 ✭✭✭


    Thinking of making a small tutorial type site for myself where i can add quick tutorials and new findings, thought it would be interesting if i used spry technology in dreamweaver,
    so whats the best way to write to an xml file, not sure if extending one xml file possible? id like everything to go into one xml file. How do they do RSS feeds?


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Well here's the RSS 2.0 specification. I don't know dreamweaver but what I would probably do (in asp.net) is create a page that writes the xml to the response when the page is requested.

    For instance the url for the programming forum RSS feed is:
    http://www.boards.ie/vbulletin/external.php?type=RSS2&forumids=25
    

    This basically tells external.php that the type is RSS2 and the forum id is 25. So external.php writes the RSS 2.0 xml for the forum with ID 25 to the request.


  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    When you say "write" to an xml file, are you talking about a form-based post, which saves the inputs as fields in an XML file on the fly? If so, the basic methodology would be.

    * User inputs data presses submit
    * Server logic process request data (inputted data),
    * Server retrieves XML file, parses, creates a document object model (DOM) hierarchy
    * The programming logic creates a new "node" from the user inputted data.
    * The logic will append this node, in the correct location, to the existing data
    * The server closes the file for editing, and returns the request with a "submit-status", ie. true or false.

    The main caveats are
    * You need access to a server-side scripting language such as PHP/JSP (I use servlets for doing XML, there are a lot of freely-available pre-built libraries such as JDOM which extend the SAX/DOM capability for traversing and manipulating XML)
    * You need public write access for your web user to edit the file.
    * You'll probably need a transformation protocol or methodology such as XSL to be able to "transform" the XML into a readable format such as text or HTML.

    There's lots of stuff on W3Schools about this, I would use that as the first port of call.

    As Phil alluded to, RSS is standardised which means that whatever you input into the form needs to be in a constrained format. Less room for manoeuvre there.

    Hope that helps.
    Stephen


Advertisement