Sedna does not support xml schema and sedna XMLSCHEMA.

Source: Internet
Author: User

Sedna does not support xml schema and sedna XMLSCHEMA.

Book. xsd:

<?xml version="1.0" encoding="utf-8"?><xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">    <xs:complexType name="book_type">        <xs:sequence>            <xs:element name="name" type="xs:string" />            <xs:element name="author" type="xs:string" />            <xs:element name="price" type="xs:unsignedInt" />            <xs:element name="date" type="xs:string" />        </xs:sequence>    </xs:complexType>    <xs:element name="books">        <xs:complexType>            <xs:sequence>                <xs:element name="book" type="book_type" minOccurs="0" maxOccurs="unbounded" />            </xs:sequence>        </xs:complexType>    </xs:element></xs:schema> 

Book. xml:

<?xml version="1.0" encoding="utf-8" ?><books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="book.xsd" >    <book>        <name>The Call Of Wild</name>        <author>Jack London</author>        <price>32</price>        <date>2015-7-6</date>    </book>    <book>        <name>Wuthering Heights</name>        <author>Emily Bronte</author>        <price>40</price>        <date>2015-7-5</date>    </book></books>

Use xmllint to check whether book. xml complies with the specification of book. xsd:

[xuzhina@localhost bin]$ xmllint --schema book.xsd book.xml<?xml version="1.0" encoding="utf-8"?><books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd"><book><name>The Call Of Wild</name><author>Jack London</author><price>32</price><date>2015-7-6</date></book><book><name>Wuthering Heights</name><author>Emily Bronte</author><price>40</price><date>2015-7-5</date></book></books>book.xml validates

Modify the price of book. xml:

<?xml version="1.0" encoding="utf-8"?><books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd"><book><name>The Call Of Wild</name><author>Jack London</author><price>3w2</price><date>2015-7-6</date></book><book><name>Wuthering Heights</name><author>Emily Bronte</author><price>hello</price><date>2015-7-5</date></book></books>

Result:

[xuzhina@localhost bin]$ xmllint --schema book.xsd book.xml<?xml version="1.0" encoding="utf-8"?><books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd"><book><name>The Call Of Wild</name><author>Jack London</author><price>3w2</price><date>2015-7-6</date></book><book><name>Wuthering Heights</name><author>Emily Bronte</author><price>hello</price><date>2015-7-5</date></book></books>book.xml:7: element price: Schemas validity error : Element 'price': '3w2' is not a valid value of the atomic type 'xs:unsignedInt'.book.xml:13: element price: Schemas validity error : Element 'price': 'hello' is not a valid value of the atomic type 'xs:unsignedInt'.book.xml fails to validate

Now import book. xml to the books database of sedna to see if sedna will validate the xml schema:

[xuzhina@localhost bin]$ ./se_term -query "LOAD 'book.xml' 'book'" booksBulk load succeeded

Conclusion: sedna does not support xml schema verification.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.