• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between JavaScript and XML

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am new to XML. The format is similar to JavaScript embodded in HTML. What is the difference? Please clarify.
Simon
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to XML too, but probably know a little better than you.
A suggestion: go to W3Schools for XML and JavaScript both will answer your question here. I just went through the XML, XSL schools during the new year break.
Happy learning!
Roseanne
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are some differences

  • XML is often used to represent "raw" data. JavaScript on the otherhand, is a part of content-rendering language more specifically designed for presentation of the data.
  • JavaScript is "heavy" because of inline Javacode. Content rendering involves compilation cycles. XML on the otherhand is "light" because it defines just the data, is language independent and doesnt require compilation( validation, XSP in XSL are exceptions )
  • JavaScript can only use "allowed" keywords on the otherhand in XML you can define your own tags which makes it more flexible than JavaScript.

  • Bottomline, these two are orthogonal technologies. They are meant for different purposes and are not mutually exclusive. Though JavaScript can be used to make XML presentation more efficient( XSL, HTML and javaScript can be used together, ) there are alternate and more efficient ways to achieve the same flexibility. Take a look at XSP and you'll know what I am talking about.
    Ajith

    [This message has been edited by Ajith Kallambella (edited January 03, 2001).]
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith

XSL, HTML and javaScript can be used together


Can you give a very simple example on it. I am looking for it actually. When I transfer my table data to an XML island, I lost some features of the original presentation, and do not how to get it back.
Another point: to my understanding, Java is portable code, and XML is portable data, not metadata. Meta data is data decribe the (real) data, such as attribute of XML tags. Correct me if I'm wrong.
Thanks!
Roseanne
[This message has been edited by Roseanne Zhang (edited January 03, 2001).]
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you are right about the metadata part. I stand corrected. Infact I think it is right to refer to both DTD or the XML Schema as the metadata for the data in XML.
XSL can act as a container for embeded HTML tags( but they should confirm to the well-formed XML rules ) and inline JavaScript. For examples, you may want to consult some good XML/XSL book. I read a little bit about it in the "Java and XML" book by O'Reilly. If you have the book, you may get some examples of it but it focuses mainly on usage of XML in Java appliations.
Thanks!
Ajith
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Ajith & Roseanne,
Thanks for your useful link and clear expl.
I will go deeper from here,
Simon
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic