XML DOM: I'm doing it all wrong, right?

Discussion in 'XML' started by goodstufffilms@gmail.com, Aug 3, 2007.

  1. Guest

    Story: (adds extra flavor)

    I'm not much of a pro at web design, but I made a site for myself
    and som
    eone noticed and asked me to make a site for their organization.
    Usually I
    use just html and JavaScript, but they want to be able to edit their
    site wi
    thout having to wade through 3 feet of my enigmatic code. I'm
    guessing PHP
    is the ideal solution, but I managed to turn 2 weeks into 3 days. A
    friend
    I work with recommended I implement XML DOM.
    I've been researching, copy/pasting code, and exhausting all sorts
    of opt
    ions and ultimately my ignorance prevails and I am unable to get the
    results
    I crave.

    The Setup: (think mood lighting)

    So far I've used PowerPoint, Paint, and Notepad... Yes, I know the
    tools o
    f a true master (except not) ...to create a website without any
    information on
    it. Sort of a skeleton if you will. I've been searching for a way
    to read
    in data from an xml file and so far the best I can get, calling a
    JavaScrip
    t function: loadXMLDoc(), is a read-in of a block of text with no
    preservati
    on of extra spaces or returns.

    Questions: (No it's not just you, these are stupid)

    What function or code should I use to retrieve data from a .txt
    or .xml file
    ?
    Is it easy preserve html code applied to the text if it has been read
    this w
    ay (such as a link)?
    Lastly are any sites you could point me at that have a few examples of
    what
    I'm trying to do?

    Thanks for reading,
    -Andrew
     
    , Aug 3, 2007
    #1
    1. Advertising

  2. wrote:
    > A friend I work with recommended I implement XML DOM.


    Uhm. Do you really mean "implement" or "use the interfaces of"?

    > loadXMLDoc(), is a read-in of a block of text with no
    > preservation of extra spaces or returns.


    XML will preserve only information which is meaningful to XML. That does
    mean some (not all) whitespace will be disarded. If that isn't what you
    want, you either mis-structured your XML document or you don't want XML.

    > What function or code should I use to retrieve data from a .txt
    > or .xml file


    There are lots of good tutorials at http://www.ibm.com, starting from
    "what is XML anyway" and working up through basic tools to fairly
    sophisticated applications. I highly recommend that you do some homework.

    What you're "doing all wrong" is that you're starting at the last moment.


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Aug 4, 2007
    #2
    1. Advertising

  3. Peter Flynn Guest

    wrote:
    > Story: (adds extra flavor)
    >
    > I'm not much of a pro at web design, but I made a site for myself and
    > som eone noticed and asked me to make a site for their organization.
    > Usually I use just html and JavaScript, but they want to be able to
    > edit their site wi thout having to wade through 3 feet of my
    > enigmatic code. I'm guessing PHP is the ideal solution, but I managed
    > to turn 2 weeks into 3 days. A friend I work with recommended I
    > implement XML DOM.


    It sounds like what you really need is none of that at all, but a simple
    content management system (CMS). There are dozens of these (leaving
    aside the corporate-level ones which cost 000s), and many of them are
    Open Source. You can even use a blog-like system to achieve this.

    What you're doing is teaching yourself XML and related techniques --
    which in itself is A Good Thing -- but not doing what your friend asked
    and making them a web site :)

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
     
    Peter Flynn, Aug 4, 2007
    #3
  4. Peter Flynn wrote:
    > What you're doing is teaching yourself XML and related techniques --
    > which in itself is A Good Thing -- but not doing what your friend asked
    > and making them a web site :)


    Good point. Focus on the goal, then pick the tools to suit the goal...


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Aug 4, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asfand Yar Qazi
    Replies:
    2
    Views:
    535
    Asfand Yar Qazi
    Sep 26, 2003
  2. Replies:
    0
    Views:
    562
  3. Kevin Dangoor

    XML with Unicode: what am I doing wrong?

    Kevin Dangoor, Feb 2, 2005, in forum: Python
    Replies:
    2
    Views:
    327
  4. Replies:
    3
    Views:
    541
    Stefan Behnel
    Aug 3, 2007
  5. Alan
    Replies:
    6
    Views:
    1,611
Loading...

Share This Page