473,790 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XHR and responseXML == null why ?

I have a page here :
<http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tml>
where i import nodes using XMLHttpRequest.

it's ok when importing an SVG file (click on "Actions" + "Import SVG")
but i get req.responseXML === null when trying to import a MathMl file
why ?

the file bernoulli.nml is ther...

--
Une Bévue
Jun 27 '08 #1
8 2628
VK
On Apr 26, 6:16 pm, unbewusst.s...@ weltanschauung. com.invalid (Une
Bévue) wrote:
I have a page here :
<http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tml>
where i import nodes using XMLHttpRequest.

it's ok when importing an SVG file (click on "Actions" + "Import SVG")
but i get req.responseXML === null when trying to import a MathMl file
why ?
Because MathML is application/xhtml+xml, not text/plain

Either serve the MathML file with the proper Content-type, or use
XHR.overrideMim eType('applicat ion/xhtml+xml') before sending request.
Jun 27 '08 #2
* Une Bévue wrote in comp.lang.javas cript:
>I have a page here :
<http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tml>
where i import nodes using XMLHttpRequest.

it's ok when importing an SVG file (click on "Actions" + "Import SVG")
but i get req.responseXML === null when trying to import a MathMl file
why ?

the file bernoulli.nml is ther...
% http-head http://thoraval.yvon.free.fr/Fixed_layout/bernoulli.nml
HTTP/1.1 200 OK
Date: Sat, 26 Apr 2008 14:35:52 GMT
Server: Apache/ProXad [Jan 10 2008 05:02:06]
Last-Modified: Sat, 26 Apr 2008 12:41:39 GMT
ETag: "169d386-85e-48132303"
Connection: close
Accept-Ranges: bytes
Content-Length: 2142
Content-Type: text/plain

You have to change your server configuration so that the document is
delivered as application/xml or a compatible MIME Type. Renaming it to
..xml might also work as a last resort.
--
Björn Höhrmann · mailto:bj****@h oehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #3
Une Bévue wrote:
I have a page here :
<http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tml>
where i import nodes using XMLHttpRequest.

it's ok when importing an SVG file (click on "Actions" + "Import SVG")
but i get req.responseXML === null when trying to import a MathMl file
why ?

the file bernoulli.nml is ther...
Make sure the XML documents you want to load with responseXML of
XMLHttpRequest are served as application/xml or text/xml.
Or use the overrideMimeTyp e method of XMLHttpRequest
http://developer.mozilla.org/en/docs...MimeType.28.29

But IE/MSXML does not provide that method.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #4
Martin Honnen <ma*******@yaho o.dewrote:
Make sure the XML documents you want to load with responseXML of
XMLHttpRequest are served as application/xml or text/xml.
Or use the overrideMimeTyp e method of XMLHttpRequest
http://developer.mozilla.org/en/docs...MimeType.28.29

But IE/MSXML does not provide that method.
Fine thanks, to all of U, i had only to change file extension :

bernoulli.nml -bernoulli.xml !!!
--
Une Bévue
Jun 27 '08 #5
VK wrote:
On Apr 26, 6:16 pm, unbewusst.s...@ weltanschauung. com.invalid (Une
Bévue) wrote:
>I have a page here :
<http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tml>
where i import nodes using XMLHttpRequest.

it's ok when importing an SVG file (click on "Actions" + "Import SVG")
but i get req.responseXML === null when trying to import a MathMl file
why ?

Because MathML is application/xhtml+xml, not text/plain
Nonsense.
Either serve the MathML file with the proper Content-type, or use
XHR.overrideMim eType('applicat ion/xhtml+xml') before sending request.
The proper media type for MathML, if there is such a thing, is text/xml or
application/xml, as it is an application of XML:

http://www.iana.org/assignments/medi...s/application/
http://www.iana.org/assignments/media-types/text/

The *recommended* media type for *an XHTML document that contains MathML
markup*, is application/xhtml+xml:

http://www.w3.org/TR/xhtml-media-types/
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jun 27 '08 #6
VK
On Apr 28, 5:46 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
Because MathML is application/xhtml+xml, not text/plain

Nonsense.
Bad breakfast again?
The proper media type for MathML, if there is such a thing, is text/xml or
application/xml, as it is an application of XML:
There is not "proper" media type for MathML because by W3C dreams it
is intended to be used only as XHTML document fragments and not as
stay-alone documents. With XHTML recommended Content-type application/
xhtml+xml it is the first one to suggest then for MathML - not to say
it makes any difference from text/xml
Jun 27 '08 #7
VK <sc**********@y ahoo.comwrote:
>
There is not "proper" media type for MathML because by W3C dreams it
is intended to be used only as XHTML document fragments and not as
stay-alone documents. With XHTML recommended Content-type application/
xhtml+xml it is the first one to suggest then for MathML - not to say
it makes any difference from text/xml
Finally, i've added :
AddType application/xhtml+xml .mml

in my .htaccess and it works great with MathML (mml sufix) even with
entities...(DOC TYPE defined in the mml file)

see <http://thoraval.yvon.f ree.fr/Fixed_layout/import_nodes.xh tmlon
Mac OS X 10.4.11 works with :
Firefox 2 : OK with MathML entities, poor result with svg (no animation)
Opera latest : MathML entities not translated, best svg.

click Action + [import SVG | MathML]

--
Une Bévue
Jun 27 '08 #8
VK wrote:
On Apr 28, 5:46 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
>>Because MathML is application/xhtml+xml, not text/plain
Nonsense.

Bad breakfast again?
>The proper media type for MathML, if there is such a thing, is text/xml or
application/xml, as it is an application of XML:

There is not "proper" media type for MathML
Yes, there is, with the provision that I named above.
because by W3C dreams it is intended to be used only as XHTML document
fragments and not as stay-alone documents.
Nonsense.
With XHTML recommended Content-type application/xhtml+xml it is the first
one to suggest then for MathML - not to say it makes any difference from text/xml
The OP is obviously trying to retrieve a standalone MathML document resource
via XHR, so the MIME media type declaration of the response should contain
an XML media type, not an XHTML media type.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2932
by: Marco Laponder | last post by:
Hi All, I am using XmlHttpRequest object within Firefox to get a xml document from the servlet. The reponseText is set but the responseXml is null. My Code is: req = new XMLHttpRequest(); req.open('GET', './transform?resource=xul', false); req.send(null);
4
13354
by: Sanjay Dahiya | last post by:
I tried POSTing from XMLHttpRequest, i can get the XML right on server but responseXML from server is coming null. I can see the XML right in responseText. but responseXML is null. responseText to DOM conversion also fails while the XML in responseText seems valid .. -- here is the javascript code for sending --- { this.request.onreadystatechange = this.handleStateChange; if( this.request) {
2
6748
by: eschl | last post by:
Doesn't "prototype.js" support the "responseXML" property of the XMLHttpRequest object? var url = "test.jsp"; var pars = ""; var myAjax = new Ajax.Request(url, {method: 'get', parameters: pars, onComplete: mycallback } );
7
5013
by: KaNos | last post by:
Hello aspx world, I consume a webservice with Javascript functions. But the response is ok and, very strange, document is null. How to resolve this problem thanks ?????? xmlHttpRequest.open("POST", myAddressLocation, false); xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); xmlHttpRequest.send(xmldocumentSoapRequest);
1
1968
by: MD | last post by:
Following snippet is the portion of my program to get the location list in xml with AJAX when i alert(request.responseText) it manages to display the xml document like the following <? xml version="1.0" ?> <markers> <marker lat="32.564" lng="133.212" /> </markers>
14
6077
by: webEater | last post by:
I downloaded IE7 and tried out the native XMLHttpRequest support. I think there is an object in IE7 called "XMLHttpRequest" but I ask me why it is called "XML"HttpRequest. I made a request to an XML file (correctly sent with text/xml header) but IE7 returns the same shit as IE 5.5/6 when I use responseXML, an XML construct with a node "xml", which contains nothing. Firefox and Opera and Netscape 7.1 (yeah,) do it correctly. What's goin...
1
2148
by: iporter | last post by:
I have several functions with code along the lines of: var xmlDoc = requestXML("ajax.asp?SP=SelectRelatedTags&tag=" + array); The requestXML() function includes the code: var xmlDoc = null; http_request.onreadystatechange = function() { if (http_request.readyState == 4) {
2
10641
by: ashish ranjan | last post by:
Hi there, I want to fetch data from database ,convert it in xml then send this xml from server.In Javascript file i am trying to parse it and bind these data to some control like textbox in client page.But the xmlHttp.responseXML.documentElement returned from server is showing null: I m using .Net,C#,(Ajax) ******************************************************** code snippet: serverPage.aspx.cs...
1
3104
by: Sand Yaah | last post by:
i went thru a discussion put by eros and helped out by dmjpros. d questions asked were right and i tried each but there was no problem there. my code returns null in xmlHttp.responseXML and xmlHttp.responseText returns nothing. My Code: function commoPrice() { var cid = document.kerala.commodities.value; if(cid ==0)
6
9832
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not valid, it will always appear as null. I am just returning some basic XML like: <?xml version='1.0' encoding='UTF-8'?> <XMLData>
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.