XHR and responseXML == null why ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?ISO-8859-1?Q?Une_B=E9v?==?ISO-8859-1?Q?ue?=

    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
  • VK

    #2
    Re: XHR and responseXML == null why ?

    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.

    Comment

    • Bjoern Hoehrmann

      #3
      Re: XHR and responseXML == null why ?

      * 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:bjoern@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/

      Comment

      • Martin Honnen

        #4
        Re: XHR and responseXML == null why ?

        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
        XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing.


        But IE/MSXML does not provide that method.


        --

        Martin Honnen

        Comment

        • =?ISO-8859-1?Q?Une_B=E9v?==?ISO-8859-1?Q?ue?=

          #5
          Re: XHR and responseXML == null why ?

          Martin Honnen <mahotrash@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
          XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing.

          >
          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

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: XHR and responseXML == null why ?

            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:




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




            PointedEars
            --
            realism: HTML 4.01 Strict
            evangelism: XHTML 1.0 Strict
            madness: XHTML 1.1 as application/xhtml+xml
            -- Bjoern Hoehrmann

            Comment

            • VK

              #7
              Re: XHR and responseXML == null why ?

              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

              Comment

              • =?ISO-8859-1?Q?Une_B=E9v?==?ISO-8859-1?Q?ue?=

                #8
                Re: XHR and responseXML == null why ?

                VK <schools_ring@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

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: XHR and responseXML == null why ?

                  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, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

                  Comment

                  Working...