#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Wellingborough, Northants, UK
    Posts
    103
    Rep Power
    14

    Question xml data file -> JavaScript -> HTML??


    Hi guys...

    Apologies first, I have already posted this in the HTML, CSS, Javascript forum but through a lack of response decided that perhaps I placed it in the wrong forum...

    I have been looking into different ways of displaying XML with formatting:

    XML + XSLT
    XML + CSS
    XML + HTML

    The first two seem ok but i found it difficult to get the XSLT to work in Mozilla/Opera/Netscape. I'm not abandoning the second combination, which although I'm sure is not too commonly used, appears to work for my needs.

    The third combination I have got working using Data islands but as you probably know this is only supported by IE and I am looking at a cross browser solution.

    I am sure I have seen a tutorial or book somewhere showing how you can use JavaScript to read from a XML doc and place it into a HTML template... can anyone shed any light on this?

    I have been known to overlook the obvious so If I am looking for the overly complicated answer to this, please point it out! Any help is very gratefully recieved.

    Many thanks,

    Dan
    DELETE FROM pay WHERE employee_name ='Dan';
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    138
    Rep Power
    12
    just my general comment because this seems to be such a general question:

    the resaon i see xslt working the best is that it processes the transformation server-side thus removing client side issues. at least for me, as long as i am outputting "good" html then my corss browser issues are simply that. the only problems left are the same as those being delt with by all other html rendering differences.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Wellingborough, Northants, UK
    Posts
    103
    Rep Power
    14

    Thanks for the info :)


    thanks for getting back on this... You have already enlightened me a bit more than what I was... I thought that XSLT was done client side like CSS, so thanks for that

    I think I will go back and look into the XSLT slotuin a bit more carefully to see if I'm just being a bit blind with regard to my code.

    Thanks again,

    Dan
    DELETE FROM pay WHERE employee_name ='Dan';
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    138
    Rep Power
    12
    It seemed to help me to view my translated xml (...now html) by viewing the source of the htmpage and looking for where my problem lies. Good luck.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Wellingborough, Northants, UK
    Posts
    103
    Rep Power
    14
    Many thanks, I will going through it later today when I get a chance, I will let you know how I get on...

    Thanks for the info,

    Dan
    DELETE FROM pay WHERE employee_name ='Dan';
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    19
    Rep Power
    0
    The cross-browser solution is to use server-side parsing of the XML files via XSLT where the webserver transforms the XML to (X)HTML and sends it to the client. That way you don't need to worry so much about browser compatibility issues.

    Because XML/XSLT require every tag to be closed, you may need to do some creative (but legal) scripting to get this to work 100% of the time. (For instance, older browser often won't complain about <br></br> but will about <br/> or <p/>).

IMN logo majestic logo threadwatch logo seochat tools logo