惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Last Watchdog
The Last Watchdog
AI
AI
Webroot Blog
Webroot Blog
aimingoo的专栏
aimingoo的专栏
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog RSS Feed
小众软件
小众软件
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
W
WeLiveSecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Troy Hunt's Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Vercel News
Vercel News
Y
Y Combinator Blog
P
Proofpoint News Feed
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
MongoDB | Blog
MongoDB | Blog
SecWiki News
SecWiki News
The Register - Security
The Register - Security
博客园_首页
T
Threat Research - Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
V
Vulnerabilities – Threatpost
I
InfoQ
雷峰网
雷峰网
C
Check Point Blog

XML | 酷 壳 - CoolShell

PFIF网上寻人协议 | 酷 壳 - CoolShell 语言的数据亲和力 | 酷 壳 - CoolShell Web开发人员速查卡 | 酷 壳 - CoolShell 那些炒作过度的技术和概念 | 酷 壳 - CoolShell SOAP的S是Simple | 酷 壳 - CoolShell 信XML,得自信 | 酷 壳 - CoolShell 信XML,得永生! | 酷 壳 - CoolShell
早期XML Schema中的open content模型 | 酷 壳 - CoolShell
Neo · 2009-04-22 · via XML | 酷 壳 - CoolShell

摘要:在看SDO的一些规范文档,可能会出现open content这样的词组,上网查了相关资料,发现这是一种XML Schema的模型,本文就描述了XML Schema的Open Content模型的含义,在最新的XML Schema规范中,好像已经没有Open模型,它的等价物是any模型。

早期发布的XML Schema规范中支持一种新的element定义,在这个定义中,你可以将XML的Element的内容定义为开放的。下面我们将会介绍一下XML的Open Content 模型。

在Open Content模型中,如果一个XML的元素在XML Schema中被声明为开放的,那么这个Schema对应的XML文档的实例就可以包含一个没有在Schema中罗列的子元素。例如,一个包含着如下的XML Schema的Schema文件

      <element name=&quot;Book&quot;>
           <type>
               <element name=&quot;Title&quot; type=&quot;string&quot;/>
               <element name=&quot;Author&quot; type=&quot;string&quot;/>
               <element name=&quot;Date&quot; type=&quot;string&quot;/>
               <element name=&quot;ISBN&quot; type=&quot;string&quot;/>
               <element name=&quot;Publisher&quot; type=&quot;string&quot;/>
           </type>
      </element>

这个book element的声明意味着这个Schema的实例XML文件必须包含5个元素 – Title,Author,Date,ISBN,Pbulish。例如:

     <Book>
         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Date>1977</Date>
         <ISBN>0-440-34319-4</ISBN>
         <Publisher>Dell Publishing Co.</Publisher>
     </Book>

假设,在实例XML文件,你希望增加book的另外一个子元素,比如,你希望增加一个到某一个网页的连接:

     <Book>
         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Date>1977</Date>
         <ISBN>0-440-34319-4</ISBN>
         <Publisher>Dell Publishing Co.</Publisher>
         <AuthorsWebPage xlink:href=&quot;<a href=&quot;http://www.rbach.com&quot;/&quot;>http://www.rbach.com&quot;/</a>>
    </Book>

对于上面这个XML文件,XML Schema分析器将会认为这个XML文件是无效的XML,因为上面的文件的包含了Scheme中没有定义的元素。但是在我们的应用场景中,我们可能会希望XML Schema分析器不要报错,因为,应用程序自己知道如何处理<AuthorsWebPage>这个元素。为了达到这个目的,我们就可以将Book声明为开放的。

Loading...