以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML工具及XML开发环境 』  (http://bbs.xml.org.cn/list.asp?boardid=7)
----  xml解析器2005新版本  (http://bbs.xml.org.cn/dispbbs.asp?boardid=7&rootid=&id=15273)


--  作者:fhml
--  发布时间:3/9/2005 10:17:00 AM

--  xml解析器2005新版本
可以说是xml的解析器了,以下是示范文件

<!-- c2s configuration -->
<c2s>
  <!-- Our ID on the network (default: c2s) -->
  <id>c2s</id>

  <!-- The process ID file. comment this out if you don't need to know
       to know the process ID from outside the process (eg for control
       scripts) -->
  <pidfile>/usr/local/var/jabberd/pid/c2s.pid</pidfile>

  <!-- Router connection configuration -->
  <router>
    <!-- IP/port the router is waiting for connections on -->
    <ip>127.0.0.1</ip>            <!-- default: 127.0.0.1 -->
    <port>5347</port>             <!-- default: 5347 -->

    <!-- Username/password to authenticate as -->
    <user>root</user>          <!-- default: jabberd -->
    <pass>123456</pass>           <!-- default: secret -->

    <!-- File containing a SSL certificate and private key to use when
         setting up an encrypted channel with the router. If this is
         commented out, or the file can't be read, no attempt will be
         made to establish an encrypted channel with the router. -->
    <!--
    <pemfile>/usr/local/etc/jabberd/server.pem</pemfile>
    -->

    <!-- Router connection retry -->
    <retry>
      <!-- If the connection to the router can't be established at
           startup, we should try again this many times before exiting.
           Use -1 to retry indefinitely. [default: 3] -->
      <init>3</init>

      <!-- If we lost the connection to the router during normal
           operation (ie we've successfully connected to the router in
           the past), we should try to reconnect this many times before
           exiting. Use -1 to retry indefinitely. [default: 3] -->
      <lost>3</lost>

      <!-- Sleep for this many seconds before trying attempting a
           reconnect. [default: 2] -->
      <sleep>2</sleep>
    </retry>
  </router>

  <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  <log type='syslog'>
    <!-- If logging to syslog, this is the log ident -->
    <ident>jabberd/c2s</ident>

    <!-- If logging to syslog, this is the log facility
         (local0 - local7)                        [default: local3] -->
    <facility>local3</facility>
    
    <!-- If logging to file, this is the filename of the logfile -->
    <!--
    <file>/usr/local/var/jabberd/log/c2s.log</file>
    -->
  </log>

  <!-- Local network configuration -->
  <local>
    <!-- Who we identify ourselves as. This should correspond to the
         ID (host) that the session manager thinks it is. You can
         specify more than one to support virtual hosts, as long as you
         have additional session manager instances on the network to
         handle those hosts. The realm attribute specifies the auth/reg
         or SASL authentication realm for the host. If the attribute is
         not specified, the realm will be selected by the SASL
         mechanism, or will be the same as the ID itself. Be aware that
         users are assigned to a realm, not a host, so two hosts in the
         same realm will have the same users.
         If no realm is specified, it will be set to be the same as the
         ID. -->
    <id>localhost</id>
    <!-- <id realm='company'>localhost</id> -->

    <!-- IP address to bind to (default: 0.0.0.0) -->
    <ip>0.0.0.0</ip>

    <!-- Port to bind to, or 0 to disable unencrypted access to the
         server (default: 5222) -->
    <port>5222</port>

    <!-- File containing a SSL certificate and private key for client
         connections. If this is commented out, clients will not be
         offered the STARTTLS stream extension -->
    <!--
    <pemfile>/usr/local/etc/jabberd/server.pem</pemfile>
    -->

    <!-- File containing an optional SSL certificate chain file for client
         SSL connections. -->
    <!--
    <cachain>/usr/local/etc/jabberd/cachain.pem</cachain>
    -->

    <!-- Require STARTTLS. If this is enabled, clients must do STARTTLS
         before they can authenticate. Until the stream is encrypted,
         all packets will be dropped. -->
    <!--
    <require-starttls/>
    -->

    <!-- Older versions of jabberd support encrypted client connections
         via an additional listening socket on port 5223. If you want
         this (required to allow pre-STARTTLS clients to do SSL),
         uncomment this -->
    <!--
    <ssl-port>5223</ssl-port>
    -->
  </local>

  <!-- Input/output settings -->
  <io>
    <!-- Maximum number of file descriptors. Note that the number of
         possible connections will be slightly less than this, because
         c2s itself can use up five on its own, and auth/reg modules may
         need a few also. If the supply of file descriptors is
         exhausted, new incoming connections will be denied.
         (default: 1024) -->
    <max_fds>1024</max_fds>

    <!-- Rate limiting -->
    <limits>
      <!-- Maximum bytes per second - if more than X bytes are sent in Y
           seconds, connection is throttled for Z seconds. The format
           is:

             <bytes seconds='Y' throttle='Z'>X</bytes>

           Default Y is 1, default Z is 5. set X to 0 to disable. -->
      <bytes>0</bytes>

      <!-- Maximum connects per second - if more than X connects are
           attempted from a single IP in Y seconds, that IP is throttled
           for Z seconds. The format is:

             <connects seconds='Y' throttle='Z'>X</connects>

           Default Y is 5, default Z is 5. set X to 0 to disable. -->
      <connects>0</connects>
    </limits>

    <!-- IP-based access controls. If a connection IP matches an allow
         rule, the connection will be accepted. If a connecting IP
         matches a deny rule, the connection will be refused. If the
         connecting IP does not match any rules, or it matches both an
         allow and a deny rule, the contents of the <order/> option
         determines what happens. -->
    <access>
      <!-- Rule check order (default: allow,deny)
           
           allow,deny - Check allow rules, then check deny rules.
                        Allow by default.
           deny,allow - Check deny rules, then check allow rules.
                        Deny by default. -->
      <order>allow,deny</order>

      <!-- Allow a network. If the mask isn't specified, it defaults to
           255.255.255.255 (ie allow onle the specified IP) -->
      <!--
      <allow ip='127.0.0.0' mask='255.0.0.0'/>
      -->

      <!-- Allow a single host -->
      <!--
      <allow ip='12.34.56.78'/>
      -->

      <!-- Deny a network or a host -->
      <!--
      <deny ip='127.0.0.1' mask='255.0.0.0'/>
      <deny ip='87.65.43.21'/>
      -->
    </access>

    <!-- Timed checks -->
    <check>
      <!-- Interval between checks.

           Open client connections will be checked every n seconds, and
           the following checks applied.

           0 disables all checks.                       (default: 0) -->
      <interval>0</interval>

      <!-- Idle connection checks.

           Connections that have not sent data for longer than this many
           seconds will be dropped.

           0 disables idle timeouts.                    (default: 0) -->
      <idle>0</idle>

      <!-- Keepalives.
           
           Connections that have not sent data for longer than this many
           seconds will have a single whitespace character sent to them.
           This will force the TCP connection to be closed if they have
           disconnected without us knowing about it.

           0 disables keepalives.                       (default: 0) -->
      <keepalive>0</keepalive>

    </check>
    
  </io>

  <!-- Authentication/registration database configuration -->
  <authreg>
    <!-- Backend module to use -->
    <module>mysql</module>

    <!-- Registration configuration -->
    <register>
      <!-- Account registration is enabled by default (provided the
           auth/reg module in use supports it). Comment this out to
           disable. -->
      <enable/>

      <!-- Human-readable instructions to be returned to client when
           registration is requested. -->
      <instructions>Enter a username and password to register with this server.</instructions>

      <!-- Password change only. When registration is disabled, it may
           still be useful to allow clients to change their password. If
           you want this, uncomment this when you disable registration. -->
      <!--
      <password/>
      -->
    </register>

    <!-- Available authentication mechanisms -->
    <mechanisms>

      <!-- These are the traditional Jabber authentication mechanisms.
           Comment out any that you don't want to be offered to clients.
           Note that if the auth/reg module does not support one of
           these mechanisms, then it will not be offered regardless of
           whether or not it is enabled here.

           Similarly, if <zerok/> is disabled, then zero-knowledge data
           will not be created when a user is registered. -->
      <traditional>
        <plain/>
        <digest/>
        <zerok/>
      </traditional>

      <!-- SASL authentication mechanisms. Comment out any that you
           don't want to be offered to clients. Again, if the auth/reg
           module does not support one of these mechanisms, then it will
           not be offered. -->
      <sasl>
        <plain/>
        <digest-md5/>
        <!--
        <anonymous/>
        -->
      </sasl>

    </mechanisms>

    <!-- MySQL module configuration -->
    <mysql>
      <!-- Database server host and port -->
      <host>localhost</host>
      <port>3306</port>

      <!-- Database name -->
      <dbname>jabberd2</dbname>

      <!-- Database username and password -->
      <user>root</user>
      <pass>123456</pass>
    </mysql>

    <!-- PostgreSQL module configuration -->
    <pgsql>
      <!-- Database server host and port -->
      <host>localhost</host>
      <port>5432</port>

      <!-- Database name -->
      <dbname>jabberd2</dbname>

      <!-- Database username and password -->
      <user>root</user>
      <pass>123456</pass>
    </pgsql>

    <!-- Berkeley DB module configuration -->
    <db>
      <!-- Directory to store database files under -->
      <path>/usr/local/var/jabberd/db</path>
      
      <!-- Synchronize the database to disk after each write. If you
           disable this, database accesses may be faster, but data may
           be lost if jabberd crashes. -->
      <sync/>
    </db>

    <!-- LDAP module configuration -->
    <ldap>
      <!-- LDAP server host and port (default: 389) -->
      <host>ldap.example.com</host>
      <port>389</port>

      <!-- Use LDAP v3 if possible. If disabled, v2 will be used.
           Encryption options are only available if v3 is enabled. -->
      <!--
      <v3/>
      -->

      <!-- Encryption. If enabled, this will create an encrypted channel
           to the LDAP server using the LDAP STARTTLS mechanism. -->
      <!--
      <starttls/>
      -->

      <!-- Encryption. If enabled, this will create an encrypted channel
           to the server using the old-style "ldaps://" mechanism. It is
           recommended that you use <starttls/> instead of this. -->
      <!--
      <ssl/>
      -->
      
      <!-- DN to bind as for searches. If unspecified, the searches
           will be done anonymously. -->
      <!--
      <binddn>cn=Directory Manager</binddn>
      <bindpw>secret</bindpw>
      -->

      <!-- LDAP attribute that holds the user ID (default: uid) -->
      <uidattr>uid</uidattr>

      <!-- base DN of the tree. You should specify a DN for each
           authentication realm declared in the <local/> section above,
           by using the realm attribute. -->
      <basedn realm='company'>o=Company.com</basedn>
      <basedn>o=Example Corp.</basedn>
    </ldap>

    <!-- Pipe module configuration -->
    <pipe>
      <!-- Program to execute -->
      <exec>/usr/local/bin/pipe-auth.pl</exec>
    </pipe>

  </authreg>

</c2s>


--  作者:fhml
--  发布时间:3/9/2005 10:21:00 AM

--  
执行解析后输出
too few param error
usage:
parser *.xml
use default parser c2s.xml
parse ended
├<c2s>
│├<id>
││└c2s
│├</id>
│├<pidfile>
││└/usr/local/var/jabberd/pid/c2s.pid
│├</pidfile>
│├<router>
││├<ip>
│││└127.0.0.1
││├</ip>
││├<port>
│││└5347
││├</port>
││├<user>
│││└root
││├</user>
││├<pass>
│││└123456
││├</pass>
││├<retry>
│││├<init>
││││└3
│││├</init>
│││├<lost>
││││└3
│││├</lost>
│││├<sleep>
││││└2
│││└</sleep>
││└</retry>
│├</router>
│├<log type='syslog' >
││├<ident>
│││└jabberd/c2s
││├</ident>
││├<facility>
│││└local3
││└</facility>
│├</log>
│├<local>
││├<id>
│││└localhost
││├</id>
││├<ip>
│││└0.0.0.0
││├</ip>
││├<port>
│││└5222
││└</port>
│├</local>
│├<io>
││├<max_fds>
│││└1024
││├</max_fds>
││├<limits>
│││├<bytes>
││││└0
│││├</bytes>
│││├<connects>
││││└0
│││└</connects>
││├</limits>
││├<access>
│││├<order>
││││└allow,deny
│││└</order>
││├</access>
││├<check>
│││├<interval>
││││└0
│││├</interval>
│││├<idle>
││││└0
│││├</idle>
│││├<keepalive>
││││└0
│││└</keepalive>
││└</check>
│├</io>
│├<authreg>
││├<module>
│││└mysql
││├</module>
││├<register>
│││├<enable/>
│││├<instructions>
││││└Enter a username and password to register with this server.
│││└</instructions>
││├</register>
││├<mechanisms>
│││├<traditional>
││││├<plain/>
││││├<digest/>
││││└<zerok/>
│││├</traditional>
│││├<sasl>
││││├<plain/>
││││└<digest-md5/>
│││└</sasl>
││├</mechanisms>
││├<mysql>
│││├<host>
││││└localhost
│││├</host>
│││├<port>
││││└3306
│││├</port>
│││├<dbname>
││││└jabberd2
│││├</dbname>
│││├<user>
││││└root
│││├</user>
│││├<pass>
││││└123456
│││└</pass>
││├</mysql>
││├<pgsql>
│││├<host>
││││└localhost
│││├</host>
│││├<port>
││││└5432
│││├</port>
│││├<dbname>
││││└jabberd2
│││├</dbname>
│││├<user>
││││└root
│││├</user>
│││├<pass>
││││└123456
│││└</pass>
││├</pgsql>
││├<db>
│││├<path>
││││└/usr/local/var/jabberd/db
│││├</path>
│││└<sync/>
││├</db>
││├<ldap>
│││├<host>
││││└ldap.example.com
│││├</host>
│││├<port>
││││└389
│││├</port>
│││├<uidattr>
││││└uid
│││├</uidattr>
│││├<basedn realm='company' >
││││└o=Company.com
│││├</basedn>
│││├<basedn>
││││└o=Example Corp.
│││└</basedn>
││├</ldap>
││├<pipe>
│││├<exec>
││││└/usr/local/bin/pipe-auth.pl
│││└</exec>
││└</pipe>
│└</authreg>
└</c2s>

--  作者:luanyun0901
--  发布时间:4/1/2005 6:27:00 PM

--  
有没有下载,想看
--  作者:54powerman
--  发布时间:4/6/2005 3:46:00 PM

--  
在哪里呢?不让下载?
--  作者:我血轩辕
--  发布时间:4/7/2005 9:48:00 AM

--  
请问如何才能自动生成DTD?比如说,我在一个表中填入基本的数据类型之后,根据基本数据类型生成DTD。
--  作者:aspx2008
--  发布时间:4/8/2005 9:00:00 PM

--  
真不錯﹗謝謝﹗
--  作者:zhangjohnson
--  发布时间:4/12/2005 8:24:00 PM

--  
我的电脑打开某一网站时要求,XML解析器升级,但不知怎么回事,其他网页都能下常打开,我可是对XML解析器一点都有不懂呀!·这可怎么办呀
--  作者:fhml
--  发布时间:4/15/2005 12:28:00 PM

--  看附件
看附件


--  作者:cake
--  发布时间:4/17/2005 3:41:00 PM

--  
看来真的是好东西呀
--  作者:summonr
--  发布时间:4/18/2005 12:59:00 AM

--  
有下载的吗?找不到附件在哪里啊!
--  作者:冰红茶
--  发布时间:4/21/2005 10:43:00 AM

--  
wo  要下

--  作者:fhml
--  发布时间:4/21/2005 11:11:00 PM

--  
晕,这个上传功能都没成功过
--  作者:smelon
--  发布时间:4/22/2005 5:04:00 PM

--  
晕,找了半天没见我以为是我眼花/
--  作者:kenneygg
--  发布时间:5/4/2005 11:54:00 PM

--  
我是新手,晕了
--  作者:jikey_zhang
--  发布时间:5/10/2005 4:17:00 PM

--  
怎么找不到下载的地方?!!
--  作者:liuliu1030
--  发布时间:5/27/2005 3:24:00 PM

--  
没看见
--  作者:luanyun0901
--  发布时间:5/28/2005 9:12:00 AM

--  
楼主,把这个解析器上传来让大家看看吧!
--  作者:Dannyzhu
--  发布时间:6/3/2005 9:59:00 AM

--  

楼主,把这个解析器上传来让大家看看吧,多谢了。


--  作者:darmy
--  发布时间:6/20/2005 9:43:00 AM

--  
怎么样才可以下载???我也想要~
--  作者:darmy
--  发布时间:6/20/2005 9:47:00 AM

--  
哪里可以下载啊?
--  作者:henanren
--  发布时间:6/22/2005 7:49:00 PM

--  
怎么没有下载地址

--  作者:kktall
--  发布时间:6/28/2005 5:04:00 PM

--  
你这是个啥东东啊,不是格式化吧,
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
140.625ms