hello, newb question about xslt

Discussion in 'XML' started by Toxician, Dec 5, 2006.

  1. Toxician

    Toxician Guest

    why can i use javascrtip to output the file below into html
    and also able to use xslt to do the same thing ???

    xml.xml
    <root>
    <node>This is a node </node>
    <root>

    ************************
    xml.js

    var doc=new activeobject("ms.xmldom");
    doc.load (xml.xml);
    doc.writeln(doc.nodename);
    doc.writeln(doc.firstchild);
    ************************

    ************************
    xml.xsl
    <xsl:stylesheet ..etc..>
    <xsl:template match='root'>
    <body><xsl:valueof select="child"/></body>
    </xsl:template>
    </xsl:stylesheet>
    ************************

    Please tel me the differnce i just leanr the basic transform, pleaee...
    Toxician, Dec 5, 2006
    #1
    1. Advertising

  2. Toxician

    Aray Guest

    --

    "Toxician" <> ????
    news:...
    > why can i use javascrtip to output the file below into html
    > and also able to use xslt to do the same thing ???
    >
    > xml.xml
    > <root>
    > <node>This is a node </node>
    > <root>
    >
    > ************************
    > xml.js
    >
    > var doc=new activeobject("ms.xmldom");
    > doc.load (xml.xml);
    > doc.writeln(doc.nodename);
    > doc.writeln(doc.firstchild);
    > ************************
    >
    > ************************
    > xml.xsl
    > <xsl:stylesheet ..etc..>
    > <xsl:template match='root'>
    > <body><xsl:valueof select="child"/></body>
    > </xsl:template>
    > </xsl:stylesheet>
    > ************************
    >
    > Please tel me the differnce i just leanr the basic transform, pleaee...
    >


    They are 2 diffrent ways. though theie distination are same.

    Using JavaScript, The Client must support JavaScript. Using XSLT, the Client
    must support XSLT.

    JavaScript is a programLanguage, It can do much more things. XSLT is live
    for XML transforming.

    XSLT is much easy to use than JavaScript to trnsform XML.
    Aray, Dec 15, 2006
    #2
    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. Carl
    Replies:
    4
    Views:
    410
    Peter Hansen
    May 21, 2004
  2. Daniel Crespo
    Replies:
    5
    Views:
    400
    Amaury
    Nov 13, 2005
  3. vijay
    Replies:
    8
    Views:
    701
  4. Replies:
    10
    Views:
    633
  5. Roy
    Replies:
    6
    Views:
    603
    Roedy Green
    Jan 7, 2008
Loading...

Share This Page