DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Berkant Guest

    Access XML-Content with Jscript?


    Hi,

    is it possible to access XML in JScript?
    I need this to use the data in our intranet page.

    Thany in advance

    Berkant

  2. #2
    Joe Guest

    Re: Access XML-Content with Jscript?


    "Berkant" <bozkurtb@web.de> wrote:
    >
    >Hi,
    >
    >is it possible to access XML in JScript?
    >I need this to use the data in our intranet page.
    >
    >Thany in advance
    >
    >Berkant

    more details are needed!!



  3. #3
    Russell Jones Guest

    Re: Access XML-Content with Jscript?

    With JScript in IE, you can create DOMDocument objects from JScript using
    code like this:

    var xmlDoc;
    xmlDoc = new ActiveXObject("msxml.DOMDocument");

    You can also access XML data islands. For example, if you have this tag in
    your HTML file:

    <xml id="doc">
    <root>
    <element1>Some content</element1>
    </root>

    You can retrieve the DOMDocument object like this:

    <script language="JScript">
    var xmlDoc;
    xmlDoc = document.all("doc").XMLDocument;
    alert(xmlDoc.xml);
    </script>

    Russell Jones
    Sr. Web Development Editor
    DevX.com


    "Berkant" <bozkurtb@web.de> wrote in message
    news:3ac9a1d3$1@news.devx.com...
    >
    > Hi,
    >
    > is it possible to access XML in JScript?
    > I need this to use the data in our intranet page.
    >
    > Thany in advance
    >
    > Berkant




  4. #4
    Joe Guest

    Re: Access XML-Content with Jscript?


    Russell,
    you are making as assumption that it is ie5 or greater. There is a world
    outside micro$oft.

    "Russell Jones" <arj1@northstate.net> wrote:
    >With JScript in IE, you can create DOMDocument objects from JScript using
    >code like this:
    >
    >var xmlDoc;
    >xmlDoc = new ActiveXObject("msxml.DOMDocument");
    >
    >You can also access XML data islands. For example, if you have this tag

    in
    >your HTML file:
    >
    ><xml id="doc">
    ><root>
    > <element1>Some content</element1>
    ></root>
    >
    >You can retrieve the DOMDocument object like this:
    >
    ><script language="JScript">
    > var xmlDoc;
    > xmlDoc = document.all("doc").XMLDocument;
    > alert(xmlDoc.xml);
    ></script>
    >
    >Russell Jones
    >Sr. Web Development Editor
    >DevX.com
    >
    >
    >"Berkant" <bozkurtb@web.de> wrote in message
    >news:3ac9a1d3$1@news.devx.com...
    >>
    >> Hi,
    >>
    >> is it possible to access XML in JScript?
    >> I need this to use the data in our intranet page.
    >>
    >> Thany in advance
    >>
    >> Berkant

    >
    >



  5. #5
    Russell Jones Guest

    Re: Access XML-Content with Jscript?

    I'm perfectly aware of that--that's why I put the warning in there. Note
    that the original poster specified JScript (MS's version), not JavaScript;
    therefore I think that was a good assumption.

    "Joe" <joed@hotmail.com> wrote in message news:3acac6d9$1@news.devx.com...
    >
    > Russell,
    > you are making as assumption that it is ie5 or greater. There is a world
    > outside micro$oft.
    >
    > "Russell Jones" <arj1@northstate.net> wrote:
    > >With JScript in IE, you can create DOMDocument objects from JScript using
    > >code like this:
    > >
    > >var xmlDoc;
    > >xmlDoc = new ActiveXObject("msxml.DOMDocument");
    > >
    > >You can also access XML data islands. For example, if you have this tag

    > in
    > >your HTML file:
    > >
    > ><xml id="doc">
    > ><root>
    > > <element1>Some content</element1>
    > ></root>
    > >
    > >You can retrieve the DOMDocument object like this:
    > >
    > ><script language="JScript">
    > > var xmlDoc;
    > > xmlDoc = document.all("doc").XMLDocument;
    > > alert(xmlDoc.xml);
    > ></script>
    > >
    > >Russell Jones
    > >Sr. Web Development Editor
    > >DevX.com
    > >
    > >
    > >"Berkant" <bozkurtb@web.de> wrote in message
    > >news:3ac9a1d3$1@news.devx.com...
    > >>
    > >> Hi,
    > >>
    > >> is it possible to access XML in JScript?
    > >> I need this to use the data in our intranet page.
    > >>
    > >> Thany in advance
    > >>
    > >> Berkant

    > >
    > >

    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links