新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 在这里讨论其他W3C规范
    [返回] 中文XML论坛 - 专业的XML技术讨论区W3CHINA.ORG讨论区 - Web新技术讨论『 其他W3C规范 』 → 请教XML高手 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 18459 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 请教XML高手 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     duxiong 帅哥哟,离线,有人找我吗?
      
      
      等级:大三(要不要学学XML呢?)
      文章:27
      积分:562
      门派:XML.ORG.CN
      注册:2004/9/13

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给duxiong发送一个短消息 把duxiong加入好友 查看duxiong的个人资料 搜索duxiong在『 其他W3C规范 』的所有贴子 引用回复这个贴子 回复这个贴子 查看duxiong的博客楼主
    发贴心情 请教XML高手

    XML标准中,对文档的定义为:
    [1]    document    ::=    ( prolog element Misc* ) - ( Char* RestrictedChar Char* )  

    请教:
    1. Misc*; Char*等的*号是什么意思?
    2. ( prolog element Misc* ) 的意思是prolog + element + Misc*吗?
    3. ( Char* RestrictedChar Char* )应该如何理解呢?也是Char* +  RestrictedChar + Char* 吗?
    4. 有没有关于这种表达式及其语法规则?或者它只是XML标准中的文本约定?

    5.万分感谢


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/8/15 10:13:00
     
     duxiong 帅哥哟,离线,有人找我吗?
      
      
      等级:大三(要不要学学XML呢?)
      文章:27
      积分:562
      门派:XML.ORG.CN
      注册:2004/9/13

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给duxiong发送一个短消息 把duxiong加入好友 查看duxiong的个人资料 搜索duxiong在『 其他W3C规范 』的所有贴子 引用回复这个贴子 回复这个贴子 查看duxiong的博客2
    发贴心情 自己找到答案了
    没人回答,好在自己找到答案了。共享一下:

    document ::= prolog element Misc*

    This production says that the symbol named document (which represents a well-formed XML document), consists simply of one prolog followed by one element followed by zero or more Miscs. Each of these symbols is defined in terms of other symbols and character sequences.

    Note that the XML 1.0 Recommendation refers to UCS characters by their Unicode scalar values, using a notation of #x followed by only as many hex digits as needed. So #x9 in the EBNF productions means the abstract character that would be represented in Unicode 3.1's "U+" notation as U+0009. It does not necessarily mean a byte with hex value 9.

    Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
    S ::= (#x20 | #x9 | #xD | #xA)+

    The first line means that Char is the one character that is in those ranges listed. Note that characters U+0000 through U+0008 and several other ranges are not considered Chars and are not allowed in XML documents. The second line shows that S is a sequence of one or more instances of any of the 4 "whitespace" characters. The definition of a Comment is given as:

    Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

    This means that Comment is the 4 characters <!-- and the 3 characters -->, in between which are 0 or more instances of either a Char that is not -, or the character - followed by a Char that is not -.

    Misc ::= Comment | PI | S

    This means that Misc is one of Comment, PI, or S. The definition of PI is too lengthy to include here, so we'll just leave it as it is.

    Since Comment and S have been defined, it would be just as accurate to say:

    Misc ::= '<!--' ((#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] - '-') | ('-' (#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] - '-')))* '-->' | PI | (#x20 | #x9 | #xD | #xA)+

    The other components of document are defined in the same way. It follows that a well-formed XML document is a UCS character sequence that follows certain patterns.

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/8/24 17:16:00
     
     cndev 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:85
      门派:XML.ORG.CN
      注册:2007/9/23

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给cndev发送一个短消息 把cndev加入好友 查看cndev的个人资料 搜索cndev在『 其他W3C规范 』的所有贴子 引用回复这个贴子 回复这个贴子 查看cndev的博客3
    发贴心情 
    1. Misc*; Char*等的*号是什么意思?
    2. ( prolog element Misc* ) 的意思是prolog + element + Misc*吗?
    3. ( Char* RestrictedChar Char* )应该如何理解呢?也是Char* +  RestrictedChar + Char* 吗?
    4. 有没有关于这种表达式及其语法规则?或者它只是XML标准中的文本约定?
    这是正规表达式的语法。
    a* 表示0个或多个a
    a+表示一个或多个a
    ab表示a和b的连接
    a|b表示a或者b
    具体的你可以在网上查一查正规表达式的语法。
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/9/23 11:33:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 其他W3C规范 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/2 6:46:13

    本主题贴数3,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    6,654.297ms