小编use*_*968的帖子

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

我把它作为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>
Run Code Online (Sandbox Code Playgroud)

我如何遍历所有事件:事件节点和显示,例如,所有事件:SessionKey?

这不起作用:

$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'));
}
Run Code Online (Sandbox Code Playgroud)

php xml namespaces simplexml

51
推荐指数
6
解决办法
8万
查看次数

为什么Subversion不允许提交.htaccess文件?

我无法从我的Windows SVN客户端(TortoiseSVN)提交.htaccess文件.返回的错误是:

无法读取状态行:远程主机强制关闭现有连接.

这基本上是我的vhost在Apache中的样子:

<VirtualHost *:80>
  DocumentRoot /var/www/mydomain.com/legacy/trunk/html
  ServerName mydomain.com

  <Directory /var/www/>
    FileETag MTime Size
    AllowOverride All
  </Directory>

  <Directory /var/www/tools>
    AllowOverride All
  </Directory>

  <Location /svn>
    DAV svn
    SVNPath /var/svn/repos/MyRepo

    # Limit write permission to list of valid users.
    # Require SSL connection for password protection.
    # SSLRequireSSL
    ErrorDocument 404 default

    AuthType Basic
    AuthName "Authorization Realm"
    AuthUserFile /etc/httpd/conf/.htpasswd
    Require valid-user
  </Location>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

如何更改,以便.htaccess文件可以提交?

svn apache .htaccess tortoisesvn rhel5

3
推荐指数
1
解决办法
8922
查看次数

标签 统计

.htaccess ×1

apache ×1

namespaces ×1

php ×1

rhel5 ×1

simplexml ×1

svn ×1

tortoisesvn ×1

xml ×1