javascript access to native XML in IE5+

javascript access to native XML in IE5+

Post by Steve Rosenberr » Sun, 21 Apr 2002 07:40:27



I have an XML file that includes a processing instruction (PI) pointing
to
an XSLT file for display using IE5+ (no HTML file to be found in this
scenario).  
When I view the source, the raw XML is displayed so I'm assuming the
browser still
has the DOM tree for it somewhere.  What I have not been able to find is
a method to access the XML DOM using javascript.  (I've seen examples
for document.load("file.xml") and document.loadXML("XMLString"), but not
if the
document is an already loaded XML file.)

Two questions:

1) Am I correct in assuming that I will be able to manipulate that raw
XML using javascript on the client side?  (I thought that was whole
point to XML+XSLT, but every example I've found is loading the XML
through HTML.)

2) Assuming the answer to 2 is yes, what's the javascript magic to get
to the XML DOM?

A third related question, is in my search travels, I've come across
hints that I may be able to simply send the modified XML back to the
server for processing.  Yes?

All pointers to relevant examples gladly accepted... :)

--
Steve Rosenberry
Sr. Partner

Electronic Solutions Company -- For the Home of Integration
http://ElectronicSolutionsCo.com

http://BetterGoBids.com -- The Premier Overture (formerly GoTo)
                           Bid Management Tool

(610) 670-1710

 
 
 

javascript access to native XML in IE5+

Post by Anandra » Mon, 22 Apr 2002 02:24:04


2.
If u want to use javascript to process XML use
var XMLDoc = new ActiveXObject("Microsoft.XMLDOM")
to create object of the msxml parser the Prog ID will differ according to
the parser version
then u can load the XML file by XMLDoc.load method .
3.
Yes u can send the XML file to the Server, Use XMLHTTP ,send  method to send
a request

Hope this will be helpfull...

Regards
Anandraj.A.



Quote:> I have an XML file that includes a processing instruction (PI) pointing
> to
> an XSLT file for display using IE5+ (no HTML file to be found in this
> scenario).
> When I view the source, the raw XML is displayed so I'm assuming the
> browser still
> has the DOM tree for it somewhere.  What I have not been able to find is
> a method to access the XML DOM using javascript.  (I've seen examples
> for document.load("file.xml") and document.loadXML("XMLString"), but not
> if the
> document is an already loaded XML file.)

> Two questions:

> 1) Am I correct in assuming that I will be able to manipulate that raw
> XML using javascript on the client side?  (I thought that was whole
> point to XML+XSLT, but every example I've found is loading the XML
> through HTML.)

> 2) Assuming the answer to 2 is yes, what's the javascript magic to get
> to the XML DOM?

> A third related question, is in my search travels, I've come across
> hints that I may be able to simply send the modified XML back to the
> server for processing.  Yes?

> All pointers to relevant examples gladly accepted... :)

> --
> Steve Rosenberry
> Sr. Partner

> Electronic Solutions Company -- For the Home of Integration
> http://ElectronicSolutionsCo.com

> http://BetterGoBids.com -- The Premier Overture (formerly GoTo)
>                            Bid Management Tool

> (610) 670-1710


 
 
 

1. Accessing XML fields with javascript

Hi everbody,

I want to access xml datafields in javascript. I created a xml island
in a html page. When someone pushed "order" button i want to pass the
XML fields to javascript and build dynamically a receipt. For instance
i have a "code", "description" and a "price".

I created a <a datafield="code" onClick="order(this);"> but then i
will only pass one parameter, but i want to pass more variables
offcourse..

Could someone help me with this?

thx
Hennie

2. Problems with Themes

3. Access xml data with JavaScript

4. PB: Report Templates(?)

5. access xml from javascript

6. Macro VAX/Alpha ISDN Comms

7. VS Add-Ins for XML

8. Daylight Savings Time

9. How to access XML via Javascript??

10. How to access XML via Javascript ?

11. Accessing original XML from javascript

12. XML DOM + IE5 + IIS + JavaScript