• <tfoot id='RHPem'></tfoot>
    <i id='RHPem'><tr id='RHPem'><dt id='RHPem'><q id='RHPem'><span id='RHPem'><b id='RHPem'><form id='RHPem'><ins id='RHPem'></ins><ul id='RHPem'></ul><sub id='RHPem'></sub></form><legend id='RHPem'></legend><bdo id='RHPem'><pre id='RHPem'><center id='RHPem'></center></pre></bdo></b><th id='RHPem'></th></span></q></dt></tr></i><div id='RHPem'><tfoot id='RHPem'></tfoot><dl id='RHPem'><fieldset id='RHPem'></fieldset></dl></div>

        <bdo id='RHPem'></bdo><ul id='RHPem'></ul>

      <small id='RHPem'></small><noframes id='RHPem'>

      1. <legend id='RHPem'><style id='RHPem'><dir id='RHPem'><q id='RHPem'></q></dir></style></legend>

        解析 XML 命名空间?

        时间:2023-09-05

          <bdo id='VF8CS'></bdo><ul id='VF8CS'></ul>
          1. <i id='VF8CS'><tr id='VF8CS'><dt id='VF8CS'><q id='VF8CS'><span id='VF8CS'><b id='VF8CS'><form id='VF8CS'><ins id='VF8CS'></ins><ul id='VF8CS'></ul><sub id='VF8CS'></sub></form><legend id='VF8CS'></legend><bdo id='VF8CS'><pre id='VF8CS'><center id='VF8CS'></center></pre></bdo></b><th id='VF8CS'></th></span></q></dt></tr></i><div id='VF8CS'><tfoot id='VF8CS'></tfoot><dl id='VF8CS'><fieldset id='VF8CS'></fieldset></dl></div>
            <tfoot id='VF8CS'></tfoot>

                  <small id='VF8CS'></small><noframes id='VF8CS'>

                • <legend id='VF8CS'><style id='VF8CS'><dir id='VF8CS'><q id='VF8CS'></q></dir></style></legend>
                    <tbody id='VF8CS'></tbody>
                • 本文介绍了解析 XML 命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  使用 JavaScript/Ajax?

                  Using JavaScript/Ajax?

                  我正在尝试从以下位置提取值:

                  I'm trying to extract values from:

                  <yweather:astronomy sunrise="6:34 am"   sunset="8:38 pm"/>
                  

                  寻找类似的东西:

                  var response = transport.responseXML.getElementsByTagName("channel");
                  sunrise = response[0].getElementsByTagName("yweather:astronomy").item(0).Attributes["sunrise"].Value;
                  

                  但到目前为止没有任何效果.:'(谢谢.

                  But nothing works so far. :'( Thanks.

                  推荐答案

                  有一个特殊版本的 getElementsByTagName 用于命名空间:getElementsByTagNameNS.

                  There is a special version of getElementsByTagName for namespaces: getElementsByTagNameNS.

                  例如:

                  var response = transport.responseXML.getElementsByTagName("channel");
                  var sunrise = response[0].getElementsByTagNameNS("[Namespace URI]", "astronomy")[0].getAttribute("sunrise");
                  

                  ...其中 [Namespace URI]yweather 命名空间的 URI.

                  ...where [Namespace URI] is the URI of the yweather namespace.

                  史蒂夫

                  这篇关于解析 XML 命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:“var FOO = FOO || 是什么?{}"(为该变量分配一个 下一篇:了解 javascript 全局命名空间和闭包

                  相关文章

                  最新文章

                  <tfoot id='kbEKe'></tfoot>

                    <i id='kbEKe'><tr id='kbEKe'><dt id='kbEKe'><q id='kbEKe'><span id='kbEKe'><b id='kbEKe'><form id='kbEKe'><ins id='kbEKe'></ins><ul id='kbEKe'></ul><sub id='kbEKe'></sub></form><legend id='kbEKe'></legend><bdo id='kbEKe'><pre id='kbEKe'><center id='kbEKe'></center></pre></bdo></b><th id='kbEKe'></th></span></q></dt></tr></i><div id='kbEKe'><tfoot id='kbEKe'></tfoot><dl id='kbEKe'><fieldset id='kbEKe'></fieldset></dl></div>
                  1. <legend id='kbEKe'><style id='kbEKe'><dir id='kbEKe'><q id='kbEKe'></q></dir></style></legend>

                        <bdo id='kbEKe'></bdo><ul id='kbEKe'></ul>

                    1. <small id='kbEKe'></small><noframes id='kbEKe'>