XML and DHTML
How do i Dynamically write an XML document into IE using script?
I get Plain Text in XML format from a web request, which I am trying to display in Tree or "Pretty Print" format. but the document.write treats it as plain txt, inspite of my first tag being <?xml .......?>.
So how do i make thw browser window treat the text as XML??????
Any help is much appreciated..
it works, i.e. it prints it out, but the browser then treats it as plain text instead of XML, which means that if I put in a reference for an XSL, it wont refer to it.
I have a way around it, i.e I myself query the XSL URL, then use the Transform Method, convert the XML to HTML and show HTML in the browser.
Or Save the file on local Temp directory and then open the window with that URL (referring to the file on local hard disk)
neither solution is good...first one requires you to make an extra Http Request, do the transformation and display, second one has obvious security problems.....
IMHO, you must create an xml object, everything else will treat your output file as text, not xml. Document.write will output your xml as it is... if formatted, it will be formatted,
if not, it will be not...
var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
You end up being who you are.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)