473,394 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

XHR and responseXML == null why ?

I have a page here :
<http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
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 2607
VK
On Apr 26, 6:16 pm, unbewusst.s...@weltanschauung.com.invalid (Une
Bévue) wrote:
I have a page here :
<http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
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.overrideMimeType('application/xhtml+xml') before sending request.
Jun 27 '08 #2
* Une Bévue wrote in comp.lang.javascript:
>I have a page here :
<http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
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****@hoehrmann.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.free.fr/Fixed_layout/import_nodes.xhtml>
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 overrideMimeType 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*******@yahoo.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 overrideMimeType 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.free.fr/Fixed_layout/import_nodes.xhtml>
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.overrideMimeType('application/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...@web.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**********@yahoo.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...(DOCTYPE defined in the mml file)

see <http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtmlon
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...@web.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.demon.co.uk>
Jun 27 '08 #9

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

Similar topics

2
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();...
4
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...
2
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:...
7
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 ?????? ...
1
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...
14
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...
1
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;...
2
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...
1
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...
6
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.