<tfoot id='MiFot'></tfoot>

      <legend id='MiFot'><style id='MiFot'><dir id='MiFot'><q id='MiFot'></q></dir></style></legend>

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

        • <bdo id='MiFot'></bdo><ul id='MiFot'></ul>

        使用 SimpleXML 使用命名空间解析 XML

        Parse XML with Namespace using SimpleXML(使用 SimpleXML 使用命名空间解析 XML)

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

            <legend id='f4JoH'><style id='f4JoH'><dir id='f4JoH'><q id='f4JoH'></q></dir></style></legend>

              • <tfoot id='f4JoH'></tfoot>
                  本文介绍了使用 SimpleXML 使用命名空间解析 XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这个作为 xml:

                  I have this as xml:

                  <root xmlns:event="http://www.webex.com/schemas/2002/06/service/event">
                      <event:event>
                          <event:sessionKey></event:sessionKey>
                          <event:sessionName>Learn QB in Minutes</event:sessionName>
                          <event:sessionType>9</event:sessionType>
                          <event:hostWebExID></event:hostWebExID>
                          <event:startDate>02/12/2009</event:startDate>
                          <event:endDate>02/12/2009</event:endDate>
                          <event:timeZoneID>11</event:timeZoneID>
                          <event:duration>30</event:duration>
                          <event:description></event:description>
                          <event:status>NOT_INPROGRESS</event:status>
                          <event:panelists></event:panelists>
                          <event:listStatus>PUBLIC</event:listStatus>
                      </event:event>
                      ...
                  </root>
                  

                  如何循环遍历所有 event:event 节点并显示,例如,所有 event:SessionKey 的?

                  How can I loop through all of the event:event nodes and display, for example, all of the event:SessionKey's?

                  这不起作用:

                  $xml = new SimpleXMLElement($r);
                  $xml->registerXPathNamespace('e', 'http://www.webex.com/schemas/2002/06/service/event');
                  
                  foreach($xml->xpath('//e:event') as $event) {
                   var_export($event->xpath('//e:sessionKey'));
                  }
                  

                  推荐答案

                  它确实可以在没有 registerXPathNamespace 和 xpath 查询中的完整命名空间前缀的情况下工作:

                  it does work without registerXPathNamespace and the full namespace prefix in the xpath queries:

                  $xml = new SimpleXMLElement($r);
                  
                  foreach($xml->xpath('//event:event') as $event) {
                   var_export($event->xpath('event:sessionKey'));
                  }
                  

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <legend id='Xk8EO'><style id='Xk8EO'><dir id='Xk8EO'><q id='Xk8EO'></q></dir></style></legend>

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

                            <bdo id='Xk8EO'></bdo><ul id='Xk8EO'></ul>
                              <tbody id='Xk8EO'></tbody>