Xml MaxOccurs、无效内容等-架构
好的,最初的查询是固定的,但我仍然有一些我感到困惑的地方 以下是xml:Xml MaxOccurs、无效内容等-架构,xml,schema,Xml,Schema,好的,最初的查询是固定的,但我仍然有一些我感到困惑的地方 以下是xml: <?xml version="1.0" encoding="UTF-8"?> <bookstore xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='schema.xsd'> <book category="COOKING"> <title l
<?xml version="1.0" encoding="UTF-8"?>
<bookstore xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='schema.xsd'>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
<photo>http://puu.sh/gNzTB/258d022e33.jpg</photo>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
<photo>http://puu.sh/gNzV9/e27dfc1b55.jpg</photo>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
日常意大利语
吉娅达·德·劳伦蒂斯
2005
30
http://puu.sh/gNzTB/258d022e33.jpg
哈利·波特
J K.罗琳
2005
29.99
http://puu.sh/gNzV9/e27dfc1b55.jpg
XQuery启动
詹姆斯·麦戈文
伯特纳
库尔特·卡格尔
詹姆斯·林恩
瓦迪亚纳坦·纳加拉扬
2003
49.99
学习XML
埃里克·T·雷
2003
39.95
模式如下:
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<!-- define elements (elements with attributes or other elemens inside are complex) -->
<xsd:element name='author' type='xsd:string' />
<xsd:element name='year' type='xsd:gYear' />
<xsd:element name='price' type='xsd:decimal' />
<xsd:element name='photo' type='xsd:anyURI' />
<!-- define attributes -->
<xsd:attribute name='category' type='xsd:string'/>
<xsd:attribute name='lang' type='xsd:string'/>
<!-- structure -->
<xsd:element name='title'>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base='xsd:string'>
<xsd:attribute ref='lang'/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name='book'>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref='title'/>
<xsd:element ref='author' maxOccurs='10'/>
<xsd:element ref='year'/>
<xsd:element ref='price'/>
<xsd:element ref='photo' minOccurs='0'/>
</xsd:sequence>
<xsd:attribute ref='category'/>
</xsd:complexType>
</xsd:element>
<xsd:element name='bookstore'>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref='book' maxOccurs='unbounded'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:element name='author' type='xsd:string' maxOccurs='10'/>
但不包括:
<xsd:element ref='author' maxOccurs='10'/>
谢谢大家! 如果您已经在模式中执行了一些更正,请发布它并解释仍然存在的问题。谢谢。我建议你只关注一个问题。目前,问题的变化太快了,所以尝试回答是不明智的。好吧,我重温了整个帖子,现在应该更清楚了。