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

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

    <tfoot id='r5vWs'></tfoot>
      <legend id='r5vWs'><style id='r5vWs'><dir id='r5vWs'><q id='r5vWs'></q></dir></style></legend>
        <bdo id='r5vWs'></bdo><ul id='r5vWs'></ul>
      1. PHP 命名空间 simplexml 问题

        时间:2024-05-11
        <i id='VI3AE'><tr id='VI3AE'><dt id='VI3AE'><q id='VI3AE'><span id='VI3AE'><b id='VI3AE'><form id='VI3AE'><ins id='VI3AE'></ins><ul id='VI3AE'></ul><sub id='VI3AE'></sub></form><legend id='VI3AE'></legend><bdo id='VI3AE'><pre id='VI3AE'><center id='VI3AE'></center></pre></bdo></b><th id='VI3AE'></th></span></q></dt></tr></i><div id='VI3AE'><tfoot id='VI3AE'></tfoot><dl id='VI3AE'><fieldset id='VI3AE'></fieldset></dl></div>
          <tbody id='VI3AE'></tbody>
          • <legend id='VI3AE'><style id='VI3AE'><dir id='VI3AE'><q id='VI3AE'></q></dir></style></legend>

          • <small id='VI3AE'></small><noframes id='VI3AE'>

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

                  问题描述

                  晚安.

                  首先要说,我已阅读 如何使用 SimpleXML 解析包含自定义命名空间的 XML?.

                  Firstly to say, I have read How do I parse XML containing custom namespaces using SimpleXML?.

                  我不介意从源解析 XML 文档,它们使用自定义命名空间.

                  I'm parsing an XML document from a source not mind, and they use a custom namespace.

                  <?xml version="1.0" encoding="utf-8"?>
                  <rss version="2.0" xmlns:moshtix="http://www.moshtix.com.au">
                    <channel>
                     <item>
                      <link>qweqwe</link>
                      <moshtix:genre>asdasd</moshtix:genre>
                  ...
                  

                  例如.当我使用 SimpleXML 解析时,没有 mostix: 命名空间元素显示或可访问.可能是一个非常简单的解决方案,但是有什么想法吗?

                  For example. When I parse using SimpleXML, none of the mostix: namespace elements are on show or accessible. Probably a really simple solution, but any ideas guys?

                  推荐答案

                  通常,人们使用 儿童().

                  $rss = simplexml_load_string(
                      '<?xml version="1.0" encoding="utf-8"?>
                      <rss version="2.0" xmlns:moshtix="http://www.moshtix.com.au">
                          <channel>
                              <link>qweqwe</link>
                              <moshtix:genre>asdasd</moshtix:genre>
                          </channel>
                      </rss>'
                  );
                  
                  foreach ($rss->channel as $channel)
                  {
                      echo 'link: ', $channel->link, "
                  ";
                      echo 'genre: ', $channel->children('moshtix', true)->genre, "
                  ";
                  }
                  

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

                  上一篇:用于在标签名称中使用冒号解析 XML 的 PHP 库? 下一篇:PHP 命名空间和“使用"

                  相关文章

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

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

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

                    1. <tfoot id='dVLiV'></tfoot>
                    2. <small id='dVLiV'></small><noframes id='dVLiV'>